PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | js/dist/externals-components.js +213 -123 28.0 → trunk View file →
@@ -1,8 +1,8 @@
1 -(()=>{var e={465(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},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,s,t){const r=t(1609),o=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},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},1509(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){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:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))});e.exports=o},1609(e){"use strict";e.exports=window.React},2353(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){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:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"}))});e.exports=o},2485(e,s){var t;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],s=0;s<arguments.length;s++){var t=arguments[s];if(t){var i=typeof t;if("string"===i||"number"===i)e.push(t);else if(Array.isArray(t)){if(t.length){var n=o.apply(null,t);n&&e.push(n)}}else if("object"===i){if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]")){e.push(t.toString());continue}for(var a in t)r.call(t,a)&&t[a]&&e.push(a)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(t=function(){return o}.apply(s,[]))||(e.exports=t)}()},2514(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){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:s},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},2863(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},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},3473(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){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:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"}))});e.exports=o},3705(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){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:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"}))});e.exports=o},3941(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){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:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"}))});e.exports=o},4259(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){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:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c1.306 0 2.417.835 2.83 2M9 14a3.001 3.001 0 00-2.83 2M15 11h3m-3 4h2"}))});e.exports=o},4925(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){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:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"}))});e.exports=o},5074(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){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:s},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},5462(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){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:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"}))});e.exports=o},5687(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},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},5941(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){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:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"}))});e.exports=o},6112(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){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:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 10h16M4 14h16M4 18h16"}))});e.exports=o},6625(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){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:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"}))});e.exports=o},6702(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){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:s},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},7219(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){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:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"}))});e.exports=o},7655(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){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:s},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"}))});e.exports=o},7656(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},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},8738(e,s,t){const r=t(1609),o=r.forwardRef(function(e,s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},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}},s={};function t(r){var o=s[r];if(void 0!==o)return o.exports;var i=s[r]={exports:{}};return e[r](i,i.exports,t),i.exports}t.n=e=>{var s=e&&e.__esModule?()=>e.default:()=>e;return t.d(s,{a:s}),s},t.d=(e,s)=>{for(var r in s)t.o(s,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:s[r]})},t.o=(e,s)=>Object.prototype.hasOwnProperty.call(e,s),(()=>{"use strict";const e=window.wp.components,s=window.wp.i18n,r=window.yoast.componentsNew,o=window.yoast.helpers,i=window.lodash,n=window.yoast.propTypes;var a=t.n(n);const l=window.wp.element,c=window.yoast.styledComponents;var d=t.n(c);const u=window.ReactJSXRuntime,p=d().div`
1 +(()=>{var e={465(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},e),o.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=r},818(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},e),o.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=r},1509(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.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:s},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))});e.exports=r},1609(e){"use strict";e.exports=window.React},2353(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.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:s},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"}))});e.exports=r},2485(e,s){var t;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],s=0;s<arguments.length;s++){var t=arguments[s];if(t){var i=typeof t;if("string"===i||"number"===i)e.push(t);else if(Array.isArray(t)){if(t.length){var n=r.apply(null,t);n&&e.push(n)}}else if("object"===i){if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]")){e.push(t.toString());continue}for(var a in t)o.call(t,a)&&t[a]&&e.push(a)}}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(t=function(){return r}.apply(s,[]))||(e.exports=t)}()},2514(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.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:s},e),o.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=r},2863(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},e),o.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=r},3473(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.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:s},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"}))});e.exports=r},3705(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.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:s},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"}))});e.exports=r},3941(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.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:s},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"}))});e.exports=r},4259(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.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:s},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c1.306 0 2.417.835 2.83 2M9 14a3.001 3.001 0 00-2.83 2M15 11h3m-3 4h2"}))});e.exports=r},4925(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.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:s},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"}))});e.exports=r},5074(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.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:s},e),o.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=r},5462(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.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:s},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"}))});e.exports=r},5687(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},e),o.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=r},5941(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.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:s},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"}))});e.exports=r},6112(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.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:s},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 10h16M4 14h16M4 18h16"}))});e.exports=r},6625(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.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:s},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"}))});e.exports=r},6702(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.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:s},e),o.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=r},7219(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.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:s},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"}))});e.exports=r},7655(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.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:s},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"}))});e.exports=r},7656(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},e),o.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=r},8738(e,s,t){const o=t(1609),r=o.forwardRef(function(e,s){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:s},e),o.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=r}},s={};function t(o){var r=s[o];if(void 0!==r)return r.exports;var i=s[o]={exports:{}};return e[o](i,i.exports,t),i.exports}t.n=e=>{var s=e&&e.__esModule?()=>e.default:()=>e;return t.d(s,{a:s}),s},t.d=(e,s)=>{for(var o in s)t.o(s,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:s[o]})},t.o=(e,s)=>Object.prototype.hasOwnProperty.call(e,s),(()=>{"use strict";const e=window.wp.components,s=window.wp.i18n,o=window.yoast.componentsNew,r=window.yoast.helpers,i=window.lodash,n=window.yoast.propTypes;var a=t.n(n);const l=window.wp.element,c=window.yoast.styledComponents;var d=t.n(c);const u=window.ReactJSXRuntime,p=d().div`
2 2 display: flex;
3 3 margin-top: 8px;
4 -`;class m extends l.Component{render(){return(0,u.jsx)(p,{children:(0,u.jsx)(r.Toggle,{id:this.props.id,labelText:(0,s.__)("Mark as cornerstone content","wordpress-seo"),isEnabled:this.props.isEnabled,onSetToggleState:this.props.onToggle,onToggleDisabled:this.props.onToggleDisabled})})}}m.propTypes={id:a().string,isEnabled:a().bool,onToggle:a().func,onToggleDisabled:a().func},m.defaultProps={id:"cornerstone-toggle",isEnabled:!0,onToggle:()=>{},onToggleDisabled:()=>{}};const h=m,g=d()(r.Collapsible)`
4 +`;class h extends l.Component{render(){return(0,u.jsx)(p,{children:(0,u.jsx)(o.Toggle,{id:this.props.id,labelText:(0,s.__)("Mark as cornerstone content","wordpress-seo"),isEnabled:this.props.isEnabled,onSetToggleState:this.props.onToggle,onToggleDisabled:this.props.onToggleDisabled})})}}h.propTypes={id:a().string,isEnabled:a().bool,onToggle:a().func,onToggleDisabled:a().func},h.defaultProps={id:"cornerstone-toggle",isEnabled:!0,onToggle:()=>{},onToggleDisabled:()=>{}};const m=h,g=window.yoast.styleGuide,y=d()(o.Collapsible)`
5 5 h2 > button {
6 6 padding-left: 24px;
7 7 padding-top: 16px;
8 8
@@ -16,24 +16,152 @@
16 16 margin: 0 24px;
17 17 border-top: 1px solid rgba(0,0,0,0.2);
18 18 }
19 19
20 -`,y=({initialIsOpen:e,id:s,...t})=>(0,u.jsx)(g,{hasPadding:!0,hasSeparator:!0,initialIsOpen:e,id:s,...t}),x=({title:e,children:s,id:t=null,prefixIcon:o=null,subTitle:i="",hasBetaBadgeLabel:n=!1,hasNewBadgeLabel:a=!1,buttonId:c=null,renderNewBadgeLabel:d=()=>{},initialIsOpen:p=!1})=>{const[m,h]=(0,l.useState)(p),g=(0,l.useRef)(null);(0,l.useEffect)(()=>{p&&g.current&&g.current.focus()},[]);const y=(0,l.useCallback)(()=>{h(e=>!e)},[h]);return(0,u.jsxs)("div",{id:t,className:"yoast components-panel__body "+(m?"is-opened":""),children:[(0,u.jsx)("h2",{className:"components-panel__body-title",children:(0,u.jsxs)("button",{ref:g,onClick:y,className:"components-button components-panel__body-toggle",type:"button",id:c,children:[(0,u.jsx)("span",{className:"yoast-icon-span",style:{fill:`${o&&o.color||""}`},children:o&&(0,u.jsx)(r.SvgIcon,{icon:o.icon,color:o.color,size:o.size})}),!a&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("span",{className:"yoast-title-container",children:[(0,u.jsx)("div",{className:"yoast-title",children:e}),i&&(0,u.jsx)("div",{className:"yoast-subtitle",children:i})]}),n&&(0,u.jsx)(r.BetaBadge,{})]}),a&&(0,u.jsxs)("div",{className:"yst-flex-grow yst-flex yst-items-center yst-gap-2",children:[(0,u.jsxs)("span",{className:"yst-overflow-x-hidden yst-leading-normal",children:[(0,u.jsx)("div",{className:"yoast-title",children:e}),i&&(0,u.jsx)("div",{className:"yoast-subtitle",children:i})]}),d()]}),(0,u.jsx)("span",{className:"yoast-chevron","aria-hidden":"true"})]})}),m&&s]})},w=x;x.propTypes={title:a().string.isRequired,children:a().oneOfType([a().node,a().arrayOf(a().node)]).isRequired,id:a().string,prefixIcon:a().object,subTitle:a().string,hasBetaBadgeLabel:a().bool,hasNewBadgeLabel:a().bool,buttonId:a().string,renderNewBadgeLabel:a().func,initialIsOpen:a().bool};const f=(0,o.makeOutboundLink)();function b({isCornerstone:t=!0,onChange:n=i.noop,learnMoreUrl:a,location:l=""}){const c="metabox"===l?y:w;return(0,u.jsxs)(c,{id:(0,o.join)(["yoast-cornerstone-collapsible",l]),title:(0,s.__)("Cornerstone content","wordpress-seo"),children:[(0,u.jsxs)(r.HelpText,{children:[(0,s.__)("Cornerstone content should be the most important and extensive articles on your site.","wordpress-seo")+" ",(0,u.jsx)(f,{href:a,children:(0,s.__)("Learn more about Cornerstone Content.","wordpress-seo")})]}),(0,u.jsx)(h,{id:(0,o.join)(["yoast-cornerstone",l]),isEnabled:t,onToggle:n}),(0,u.jsx)(e.Slot,{name:"YoastAfterCornerstoneToggle"})]})}b.propTypes={isCornerstone:a().bool,onChange:a().func,learnMoreUrl:a().string.isRequired,location:a().string};const v=window.wp.compose,k=window.wp.data,_=window.yoast.externals.contexts,j=window.wp.url,S=window.wp.apiFetch;var C=t.n(S);const R=window.yoast.uiLibrary,E=window.yoast.relatedKeyphraseSuggestions;var L=t(2353),N=t.n(L);const M=({isLoggedIn:e=!1,location:t,onModalOpen:r,onLinkClick:o})=>{const i=e?{onClick:r}:{as:"a",href:"https://oauth.semrush.com/oauth2/authorize?ref=1513012826&client_id=yoast&redirect_uri=https%3A%2F%2Foauth.semrush.com%2Foauth2%2Fyoast%2Fsuccess&response_type=code&scope=user.id",onClick:o};return(0,u.jsx)("div",{className:"yoast",children:(0,u.jsxs)(R.Button,{variant:"secondary",id:`yoast-get-related-keyphrases-${t}`,className:"yst-gap-1.5 yst-mt-0",...i,children:[(0,u.jsx)(N(),{className:"yst-w-4 yst-h-4 yst-text-slate-400"}),(0,s.__)("Discover related keyphrases","wordpress-seo"),!e&&(0,u.jsx)("span",{className:"screen-reader-text",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
21 -(0,s.__)("(Opens in a new browser tab)","wordpress-seo")})]})})};M.propTypes={isLoggedIn:a().bool,location:a().string.isRequired,onModalOpen:a().func.isRequired,onLinkClick:a().func.isRequired};class I extends l.Component{constructor(e){super(e),this.onModalOpen=this.onModalOpen.bind(this),this.onLinkClick=this.onLinkClick.bind(this),this.listenToMessages=this.listenToMessages.bind(this)}onModalOpen(){const{keyphrase:e,onOpenWithNoKeyphrase:s,onOpen:t,location:r,newRequest:o,countryCode:i}=this.props;e.trim()?(t(r),o(i,e)):s()}onLinkClick(e){if(e.preventDefault(),!this.props.keyphrase.trim())return void this.props.onOpenWithNoKeyphrase();const s=e.target.href,t=["top="+(window.top.outerHeight/2+window.top.screenY-285),"left="+(window.top.outerWidth/2+window.top.screenX-170),"width=340","height=570","resizable=1","scrollbars=1","status=0"];this.popup&&!this.popup.closed||(this.popup=window.open(s,"SEMrush_login",t.join(","))),this.popup&&this.popup.focus(),window.addEventListener("message",this.listenToMessages,!1)}async listenToMessages(e){const{data:s,source:t,origin:r}=e;"https://oauth.semrush.com"===r&&this.popup===t&&("semrush:oauth:success"===s.type&&(this.popup.close(),window.removeEventListener("message",this.listenToMessages,!1),await this.performAuthenticationRequest(s)),"semrush:oauth:denied"===s.type&&(this.popup.close(),window.removeEventListener("message",this.listenToMessages,!1),this.props.onAuthentication(!1)))}async performAuthenticationRequest(e){try{const s=new URL(e.url).searchParams.get("code"),t=await C()({path:"yoast/v1/semrush/authenticate",method:"POST",data:{code:s}});200===t.status?(this.props.onAuthentication(!0),this.onModalOpen(),this.popup.close()):console.error(t.error)}catch(e){console.error(e.message)}}render(){const{keyphrase:s,location:t,whichModalOpen:r,onClose:o,countryCode:i,learnMoreLink:n,isLoggedIn:a}=this.props,l=new URL("https://www.semrush.com/analytics/keywordoverview/");return l.searchParams.append("q",s),l.searchParams.append("db",i),(0,u.jsxs)(R.Root,{children:[(0,u.jsx)(M,{isLoggedIn:a,location:t,onLinkClick:this.onLinkClick,onModalOpen:this.onModalOpen}),(0,u.jsx)(E.Modal,{isOpen:Boolean(s)&&r===t,onClose:o,insightsLink:l.toString(),learnMoreLink:n,children:(0,u.jsx)(e.Slot,{name:"YoastRelatedKeyphrases"})})]})}}I.propTypes={keyphrase:a().string,location:a().string,whichModalOpen:a().oneOf(["none","metabox","sidebar"]),isLoggedIn:a().bool,onOpen:a().func.isRequired,onOpenWithNoKeyphrase:a().func.isRequired,onClose:a().func.isRequired,onAuthentication:a().func.isRequired,countryCode:a().string,learnMoreLink:a().string,newRequest:a().func.isRequired},I.defaultProps={keyphrase:"",location:"",whichModalOpen:"none",isLoggedIn:!1,countryCode:"en_US",learnMoreLink:""};const T=I,P=(0,v.compose)([(0,k.withSelect)(e=>{const{getSEMrushModalOpen:s,getSEMrushLoginStatus:t,getSEMrushSelectedCountry:r,getPreference:o,selectLinkParams:i,getFocusKeyphrase:n}=e("yoast-seo/editor");return{whichModalOpen:s(),isLoggedIn:t(),countryCode:r(),isRtl:o("isRtl",!1),learnMoreLink:(0,j.addQueryArgs)("https://yoa.st/3-v",i()),keyphrase:n()}}),(0,k.withDispatch)(e=>{const{setSEMrushNoKeyphraseMessage:s,setSEMrushOpenModal:t,setSEMrushDismissModal:r,setSEMrushLoginStatus:o,setSEMrushNewRequest:i}=e("yoast-seo/editor");return{onOpenWithNoKeyphrase:()=>{s()},onOpen:e=>{t(e)},onClose:()=>{r()},onAuthentication:e=>{o(e)},newRequest:(e,s)=>{i(e,s)}}})])(T);function A({location:s}){return(0,u.jsx)(e.Slot,{name:`yoast-synonyms-${s}`})}A.propTypes={location:a().string.isRequired};const O=(e,s)=>{try{return(0,l.createInterpolateElement)(e,s)}catch(s){return console.error("Error in translation for:",e,s),e}};t(6702);a().string.isRequired;var B=t(2514),F=t.n(B),q=t(818),$=t.n(q);const U=({learnMoreLink:e,thumbnail:t,wistiaEmbedPermission:r,upsellLink:o,upsellLabel:i=(0,s.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. */ /* translators: %1$s expands to Yoast SEO Premium. */
22 -(0,s.__)("Unlock with %1$s","wordpress-seo"),"Yoast SEO Premium"),newToText:n="Yoast SEO Premium",ctbId:a="f6a84663-465f-4cb5-8ba5-f7a6d72224b2"})=>{const{onClose:l,initialFocus:c}=(0,R.useModalContext)(),d={a:(0,u.jsx)(re,{href:e,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,u.jsx)($(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"}),br:(0,u.jsx)("br",{})};return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center",children:[(0,u.jsxs)("div",{className:"yst-relative yst-w-full",children:[(0,u.jsx)(xe,{videoId:"vun9z1dpfh",thumbnail:t,wistiaEmbedPermission:r}),(0,u.jsx)(R.Badge,{className:"yst-absolute yst-end-4 yst-text-center yst-justify-center",variant:"info",style:{top:"-8px"},children:(0,s.__)("Beta","wordpress-seo")})]}),(0,u.jsx)("div",{className:"yst-mt-6 yst-text-xs yst-font-medium yst-flex yst-flex-col yst-items-center",children:(0,u.jsxs)("span",{className:"yst-introduction-modal-uppercase yst-flex yst-gap-2 yst-items-center",children:[(0,u.jsx)("span",{className:"yst-logo-icon"}),n]})})]}),(0,u.jsxs)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center",children:[(0,u.jsxs)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center",children:[(0,u.jsx)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium",children:(0,s.sprintf)(/* translators: %s: Expands to "Yoast AI" */ /* translators: %s: Expands to "Yoast AI" */
23 -(0,s.__)("Optimize your SEO content with %s","wordpress-seo"),"Yoast AI")}),(0,u.jsx)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm",children:O((0,s.sprintf)(/* translators: %1$s is a break tag; %2$s and %3$s are anchor tags; %4$s is the arrow icon. */ /* translators: %1$s is a break tag; %2$s and %3$s are anchor tags; %4$s is the arrow icon. */
24 -(0,s.__)("Make content editing a breeze! Optimize your SEO content with quick, actionable suggestions at the click of a button.%1$s%2$sLearn more%3$s%4$s","wordpress-seo"),"<br/>","<a>","<ArrowNarrowRightIcon />","</a>"),d)})]}),(0,u.jsx)("div",{className:"yst-w-full yst-flex yst-mt-6",children:(0,u.jsxs)(R.Button,{as:"a",className:"yst-grow",size:"extra-large",variant:"upsell",href:o,target:"_blank",ref:c,"data-action":"load-nfd-ctb","data-ctb-id":a,children:[(0,u.jsx)(F(),{className:"yst--ms-1 yst-me-2 yst-h-5 yst-w-5"}),i,(0,u.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
25 -(0,s.__)("(Opens in a new browser tab)","wordpress-seo")})]})}),(0,u.jsx)(R.Button,{as:"a",className:"yst-mt-4",variant:"tertiary",onClick:l,children:(0,s.__)("Close","wordpress-seo")})]})]})};U.propTypes={learnMoreLink:a().string.isRequired,upsellLink:a().string.isRequired,thumbnail:a().shape({src:a().string.isRequired,width:a().string,height:a().string}).isRequired,wistiaEmbedPermission:a().shape({value:a().bool.isRequired,status:a().string.isRequired,set:a().func.isRequired}).isRequired,upsellLabel:a().string,newToText:a().string,ctbId:a().string};const W=({handleRefreshClick:e,supportLink:t})=>(0,u.jsxs)("div",{className:"yst-flex yst-gap-2",children:[(0,u.jsx)(R.Button,{onClick:e,children:(0,s.__)("Refresh this page","wordpress-seo")}),(0,u.jsx)(R.Button,{variant:"secondary",as:"a",href:t,target:"_blank",rel:"noopener",children:(0,s.__)("Contact support","wordpress-seo")})]});W.propTypes={handleRefreshClick:a().func.isRequired,supportLink:a().string.isRequired};const H=({handleRefreshClick:e,supportLink:t})=>(0,u.jsxs)("div",{className:"yst-grid yst-grid-cols-1 yst-gap-y-2",children:[(0,u.jsx)(R.Button,{className:"yst-order-last",onClick:e,children:(0,s.__)("Refresh this page","wordpress-seo")}),(0,u.jsx)(R.Button,{variant:"secondary",as:"a",href:t,target:"_blank",rel:"noopener",children:(0,s.__)("Contact support","wordpress-seo")})]});H.propTypes={handleRefreshClick:a().func.isRequired,supportLink:a().string.isRequired};const z=({error:e,children:t=null})=>(0,u.jsxs)("div",{role:"alert",className:"yst-max-w-screen-sm yst-p-8 yst-space-y-4",children:[(0,u.jsx)(R.Title,{children:(0,s.__)("Something went wrong. An unexpected error occurred.","wordpress-seo")}),(0,u.jsx)("p",{children:(0,s.__)("We're very sorry, but it seems like the following error has interrupted our application:","wordpress-seo")}),(0,u.jsx)(R.Alert,{variant:"error",children:(null==e?void 0:e.message)||(0,s.__)("Undefined error message.","wordpress-seo")}),(0,u.jsx)("p",{children:(0,s.__)("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]});z.propTypes={error:a().object.isRequired,children:a().node},z.VerticalButtons=H,z.HorizontalButtons=W;a().string,a().node.isRequired,a().node.isRequired,a().node,a().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 D=t(1609),K=t.n(D);const G=window.ReactDOM;var Y,V,Z;(V=Y||(Y={})).Pop="POP",V.Push="PUSH",V.Replace="REPLACE",function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(Z||(Z={})),new Set(["lazy","caseSensitive","path","id","index","children"]),Error;const Q=["post","put","patch","delete"],J=(new Set(Q),["get",...Q]);new Set(J),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred"),D.Component,D.startTransition,new Promise(()=>{}),D.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(e){}var X,ee,se,te;new Map,D.startTransition,G.flushSync,D.useId,"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,(te=X||(X={})).UseScrollRestoration="useScrollRestoration",te.UseSubmit="useSubmit",te.UseSubmitFetcher="useSubmitFetcher",te.UseFetcher="useFetcher",te.useViewTransitionState="useViewTransitionState",(se=ee||(ee={})).UseFetcher="useFetcher",se.UseFetchers="useFetchers",se.UseScrollRestoration="useScrollRestoration",a().string.isRequired,a().string;const re=({href:e,children:t=null,...r})=>(0,u.jsxs)(R.Link,{target:"_blank",rel:"noopener noreferrer",...r,href:e,children:[t,(0,u.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
26 -(0,s.__)("(Opens in a new browser tab)","wordpress-seo")})]});re.propTypes={href:a().string.isRequired,children:a().node};var oe=t(8738),ie=t.n(oe);(0,s.__)("Create optimized SEO titles & meta descriptions in seconds","wordpress-seo"),(0,s.__)("Apply AI suggestions to improve content in 1 click","wordpress-seo"),(0,s.__)("Manage redirects with ease and without extra plugins","wordpress-seo"),(0,s.__)("Optimize pages for multiple keywords with guidance","wordpress-seo"),(0,s.__)("Add product details to help your listings stand out","wordpress-seo"),(0,s.__)("Make sure search engines show the right version of your product page","wordpress-seo"),(0,s.__)("Create optimized SEO titles & meta descriptions with AI","wordpress-seo"),(0,s.__)("Receive clear SEO and readability guidance to optimize your products","wordpress-seo"),(0,s.__)("Generate SEO optimized metadata in seconds with AI","wordpress-seo"),(0,s.__)("Make your articles visible, be seen in Google News","wordpress-seo"),(0,s.__)("Built to get found by search, AI, and real users","wordpress-seo"),(0,s.__)("Easy Local SEO. Show up in Google Maps results","wordpress-seo"),(0,s.__)("Internal links and redirect management, easy","wordpress-seo"),(0,s.__)("Access to friendly help when you need it, day or night","wordpress-seo");var ne=t(2485),ae=t.n(ne);var le;function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},ce.apply(null,arguments)}a().string.isRequired,a().object.isRequired,a().func.isRequired,a().bool.isRequired,t(3473);const de=e=>D.createElement("svg",ce({xmlns:"http://www.w3.org/2000/svg",fill:"none","aria-hidden":"true",viewBox:"0 0 16 12"},e),le||(le=D.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"})));a().string.isRequired,a().object,a().func.isRequired,a().bool.isRequired,a().string.isRequired,a().object.isRequired,a().string.isRequired,a().func.isRequired,a().bool.isRequired,t(5074),a().bool.isRequired,a().func,a().func,a().string.isRequired,a().string.isRequired,a().string.isRequired,a().string.isRequired;const ue=window.yoast.reactHelmet,pe="error",me="loading",he="showPlay",ge="askPermission",ye="isPlaying",xe=({videoId:e,thumbnail:t,wistiaEmbedPermission:r,className:o=""})=>{const[i,n]=(0,l.useState)(r.value?ye:he),a=(0,l.useCallback)(()=>n(ye),[n]),c=(0,l.useCallback)(()=>{r.value?a():n(ge)},[r.value,a,n]),d=(0,l.useCallback)(()=>n(he),[n]),p=(0,l.useCallback)(()=>{r.set(!0),a()},[r.set,a]);return(0,u.jsxs)(u.Fragment,{children:[r.value&&(0,u.jsx)(ue.Helmet,{children:(0,u.jsx)("script",{src:"https://fast.wistia.com/assets/external/E-v1.js",async:!0})}),(0,u.jsxs)("div",{className:ae()("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",o),children:[i===he&&(0,u.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,u.jsx)("img",{className:"yst-w-full yst-h-auto yst-object-contain",alt:"",loading:"lazy",decoding:"async",...t})}),i===ge&&(0,u.jsxs)("div",{className:"yst-absolute yst-inset-0 yst-flex yst-flex-col yst-items-center yst-justify-center yst-bg-white",children:[(0,u.jsxs)("p",{className:"yst-max-w-xs yst-mx-auto yst-text-center",children:[r.status===me&&(0,u.jsx)(R.Spinner,{}),r.status!==me&&(0,s.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. */
27 -(0,s.__)("To see this video, you need to allow %1$s to load embedded videos from %2$s.","wordpress-seo"),"Yoast SEO","Wistia")]}),(0,u.jsxs)("div",{className:"yst-flex yst-mt-6 yst-gap-x-4",children:[(0,u.jsx)(R.Button,{type:"button",variant:"secondary",onClick:d,disabled:r.status===me,children:(0,s.__)("Deny","wordpress-seo")}),(0,u.jsx)(R.Button,{type:"button",variant:"primary",onClick:p,disabled:r.status===me,children:(0,s.__)("Allow","wordpress-seo")})]})]}),r.value&&i===ye&&(0,u.jsxs)("div",{className:"yst-absolute yst-w-full yst-h-full yst-top-0 yst-right-0",children:[null===e&&(0,u.jsx)(R.Spinner,{className:"yst-h-full yst-mx-auto"}),null!==e&&(0,u.jsx)("div",{className:`wistia_embed wistia_async_${e} videoFoam=true`})]})]})]})};xe.propTypes={videoId:a().string.isRequired,thumbnail:a().shape({src:a().string.isRequired,width:a().string,height:a().string}).isRequired,wistiaEmbedPermission:a().shape({value:a().bool.isRequired,status:a().string.isRequired,set:a().func.isRequired}).isRequired,hasPadding:a().bool},t(5687),a().bool.isRequired,a().func.isRequired,a().func,a().string;const we=({onGiveConsent:e,learnMoreLink:t,privacyPolicyLink:r,termsOfServiceLink:o,imageLink:i})=>{const{onClose:n,initialFocus:a}=(0,R.useModalContext)(),[c,d]=(0,R.useToggleState)(!1),p=(0,l.useMemo)(()=>({src:i,width:"432",height:"244"}),[i]),m=O((0,s.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. */
28 -(0,s.__)("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,u.jsx)(re,{href:o}),a2:(0,u.jsx)(re,{href:r})}),[h,g]=(0,R.useToggleState)(!1),y=(0,l.useCallback)(async()=>{g(),await e(),g()},[e]);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center",children:(0,u.jsx)("div",{className:"yst-relative yst-w-full",children:(0,u.jsx)("img",{className:"yst-w-full yst-h-auto yst-rounded-md yst-drop-shadow-md",alt:"",loading:"lazy",decoding:"async",...p})})}),(0,u.jsxs)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center",children:[(0,u.jsxs)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center",children:[(0,u.jsx)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium",children:(0,s.sprintf)(/* translators: %s expands to Yoast AI. */ /* translators: %s expands to Yoast AI. */
29 -(0,s.__)("Grant consent for %s","wordpress-seo"),"Yoast AI")}),(0,u.jsx)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm",children:O((0,s.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. */
30 -(0,s.__)("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,u.jsx)(re,{href:t,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,u.jsx)($(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"}),br:(0,u.jsx)("br",{})})})]}),(0,u.jsx)("div",{className:"yst-flex yst-w-full yst-mt-6",children:(0,u.jsx)("hr",{className:"yst-w-full yst-text-gray-200"})}),(0,u.jsxs)("div",{className:"yst-flex yst-items-start yst-mt-4",children:[(0,u.jsx)("input",{type:"checkbox",id:"yst-ai-consent-checkbox",name:"yst-ai-consent-checkbox",checked:c,value:c?"true":"false",onChange:d,className:"yst-checkbox__input",ref:a}),(0,u.jsx)("label",{htmlFor:"yst-ai-consent-checkbox",className:"yst-label yst-checkbox__label yst-text-xs yst-font-normal yst-text-slate-500",children:m})]}),(0,u.jsx)("div",{className:"yst-w-full yst-flex yst-mt-4",children:(0,u.jsxs)(R.Button,{as:"button",className:"yst-grow",size:"large",disabled:!c,onClick:y,children:[h&&(0,u.jsx)(R.Spinner,{className:"yst-me-2"}),(0,s.__)("Grant consent","wordpress-seo")]})}),(0,u.jsx)(R.Button,{as:"button",className:"yst-mt-4",variant:"tertiary",onClick:n,children:(0,s.__)("Close","wordpress-seo")})]})]})};we.propTypes={onGiveConsent:a().func.isRequired,learnMoreLink:a().string.isRequired,privacyPolicyLink:a().string.isRequired,termsOfServiceLink:a().string.isRequired,imageLink:a().string.isRequired};const fe={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"},be=({storeName:e,onConsentGranted:s,linkStoreName:t,links:r={}})=>{const o=(0,l.useMemo)(()=>({...fe,...r}),[r]),{termsOfServiceLink:i,privacyPolicyLink:n,learnMoreLink:a,imageLink:c,endpoint:d}=(0,k.useSelect)(s=>{const r=s(t),i=s(e);return{termsOfServiceLink:r.selectLink(o.termsOfService),privacyPolicyLink:r.selectLink(o.privacyPolicy),learnMoreLink:r.selectLink(o.learnMore),imageLink:r.selectImageLink("ai-consent.jpg"),endpoint:i.selectAiGeneratorConsentEndpoint()}},[t,e,o]),{storeAiGeneratorConsent:p}=(0,k.useDispatch)(e),m=(0,l.useCallback)(async()=>{await p(!0,d),s()},[p,s,d]);return(0,u.jsx)(we,{termsOfServiceLink:i,privacyPolicyLink:n,learnMoreLink:a,imageLink:c,onGiveConsent:m})};be.propTypes={storeName:a().string.isRequired,onConsentGranted:a().func.isRequired,linkStoreName:a().string.isRequired,links:a().shape({termsOfService:a().string,privacyPolicy:a().string,learnMore:a().string})};const ve=({location:e,keyword:t,handleChange:r,onFocusKeyword:o,onBlurKeyword:i,validation:n=null})=>(0,u.jsx)(R.TextField,{id:`focus-keyword-input-${e}`,label:(0,s.__)("Focus keyphrase","wordpress-seo"),value:t,onChange:r,onFocus:o,onBlur:i,validation:n,autoComplete:"off",placeholder:(0,s.__)("Type here","wordpress-seo"),description:O((0,s.sprintf)(/* translators: %1$s and %2$s are anchor tags. */ /* translators: %1$s and %2$s are anchor tags. */
31 -(0,s.__)("Use the main word or phrase you want your content found for across search, AI, and beyond. %1$sLearn more about best practices for keyphrases.%2$s","wordpress-seo"),"<a>","</a>"),{a:(0,u.jsx)(re,{href:wpseoAdminL10n["shortlinks.focus_keyword_info"],variant:"default"})})});ve.propTypes={location:a().string.isRequired,keyword:a().string.isRequired,handleChange:a().func.isRequired,onFocusKeyword:a().func.isRequired,onBlurKeyword:a().func.isRequired,validation:a().shape({variant:a().string,message:a().node})};const ke=e=>`YoastAfterKeywordInput${e.charAt(0).toUpperCase()+e.slice(1)}`,_e=(e,s,t)=>e?(0,u.jsx)(P,{location:s,keyphrase:t}):null,je=({keyword:t="",onFocusKeywordChange:r,onFocusKeyword:o,onBlurKeyword:i,isSEMrushIntegrationActive:n=!1,displayNoKeyphraseMessage:a=!1,displayNoKeyphrasForTrackingMessage:c=!1,errors:d=[]})=>{const p=(0,l.useContext)(_.LocationContext),m=(e=>"metabox"===e?y:w)(p),h=(0,l.useCallback)(e=>r(e.target.value),[r]),g=((e,t,r,o)=>{const i=(({errors:e,keyword:t,displayNoKeyphraseMessage:r,displayNoKeyphrasForTrackingMessage:o})=>{const i=0===t.trim().length;return[...e,...[{condition:i&&r,message:(0,s.__)("Please enter a focus keyphrase first to get related keyphrases","wordpress-seo")},{condition:i&&o,message:(0,s.__)("Please enter a focus keyphrase first to track keyphrase performance","wordpress-seo")},{condition:t.includes(","),message:(0,s.__)("Are you trying to use multiple keyphrases? You should add them separately below.","wordpress-seo")},{condition:t.length>191,message:(0,s.__)("Your keyphrase is too long. It can be a maximum of 191 characters.","wordpress-seo")}].filter(({condition:e})=>e).map(({message:e})=>e)]})({errors:e,keyword:t,displayNoKeyphraseMessage:r,displayNoKeyphrasForTrackingMessage:o});return i.length>0?{variant:"error",message:i.map((e,s)=>(0,u.jsx)("span",{role:"alert",className:"yst-block",children:e},s))}:null})(d,t,a,c);return(0,u.jsxs)(m,{id:`yoast-focus-keyphrase-collapsible-${p}`,buttonId:`yoast-focus-keyphrase-collapsible-button-${p}`,title:(0,s.__)("Focus keyphrase","wordpress-seo"),initialIsOpen:!0,children:[(0,u.jsxs)("div",{className:"yst-root yst-space-y-4",children:[(0,u.jsx)(ve,{location:p,keyword:t,handleChange:h,onFocusKeyword:o,onBlurKeyword:i,validation:g}),(0,u.jsx)(A,{location:p}),_e(n,p,t)]}),(0,u.jsx)(e.Slot,{name:ke(p)})]})};je.propTypes={keyword:a().string,onFocusKeywordChange:a().func.isRequired,onFocusKeyword:a().func.isRequired,onBlurKeyword:a().func.isRequired,isSEMrushIntegrationActive:a().bool,displayNoKeyphraseMessage:a().bool,displayNoKeyphrasForTrackingMessage:a().bool,errors:a().arrayOf(a().string)};const Se=(0,v.compose)([(0,k.withSelect)(e=>{const{getFocusKeyphrase:s,getSEMrushNoKeyphraseMessage:t,hasWincherNoKeyphrase:r,getFocusKeyphraseErrors:o}=e("yoast-seo/editor");return{keyword:s(),displayNoKeyphraseMessage:t(),displayNoKeyphrasForTrackingMessage:r(),errors:o()}}),(0,k.withDispatch)(e=>{const{setFocusKeyword:s,setMarkerPauseStatus:t}=e("yoast-seo/editor");return{onFocusKeywordChange:s,onFocusKeyword:()=>t(!0),onBlurKeyword:()=>t(!1)}})])(je);function Ce(e){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ce(e)}function Re(e,s,t){return(s=function(e){var s=function(e){if("object"!=Ce(e)||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var t=s.call(e,"string");if("object"!=Ce(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ce(s)?s:s+""}(s))in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}const Ee=window.yoast.styleGuide,Le=window.yoast.analysis;function Ne(e,s=""){const t=e.getIdentifier(),r={score:e.score,rating:Le.interpreters.scoreToRating(e.score),hasMarks:e.hasMarks(),marker:e.getMarker(),id:t,text:e.text,markerId:s.length>0?`${s}:${t}`:t,hasBetaBadge:e.hasBetaBadge(),hasJumps:e.hasJumps(),hasAIFixes:e.hasAIFixes(),editFieldName:e.editFieldName,editFieldAriaLabel:e.editFieldAriaLabel};return"ok"===r.rating&&(r.rating="OK"),r}function Me(e,s){switch(e.rating){case"error":s.errorsResults.push(e);break;case"feedback":s.considerationsResults.push(e);break;case"bad":s.problemsResults.push(e);break;case"OK":s.improvementsResults.push(e);break;case"good":s.goodResults.push(e)}return s}function Ie(e){switch(e){case"loading":return{icon:"loading-spinner",color:Ee.colors.$color_green_medium_light};case"not-set":return{icon:"seo-score-none",color:Ee.colors.$color_score_icon};case"noindex":return{icon:"seo-score-none",color:Ee.colors.$color_noindex};case"good":return{icon:"seo-score-good",color:Ee.colors.$color_green_medium};case"ok":return{icon:"seo-score-ok",color:Ee.colors.$color_ok};default:return{icon:"seo-score-bad",color:Ee.colors.$color_red}}}function Te(e,s=""){let t={errorsResults:[],problemsResults:[],improvementsResults:[],goodResults:[],considerationsResults:[]};if(!e)return t;for(let r=0;r<e.length;r++){const o=e[r];o.text&&(t=Me(Ne(o,s),t))}return t}function Pe({target:e,children:s}){let t=e;return"string"==typeof e&&(t=document.getElementById(e)),t?(0,l.createPortal)(s,t):null}Pe.propTypes={target:a().oneOfType([a().string,a().object]).isRequired,children:a().node.isRequired};const Ae=({target:e,scoreIndicator:s})=>(0,u.jsx)(Pe,{target:e,children:(0,u.jsx)(r.SvgIcon,{...Ie(s)})});Ae.propTypes={target:a().string.isRequired,scoreIndicator:a().string.isRequired};const Oe=Ae,Be=window.yoast.analysisReport;var Fe=t(465),qe=t.n(Fe);const $e=window.wp.hooks;var Ue,We;function He(){return He=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},He.apply(null,arguments)}const ze=e=>D.createElement("svg",He({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 425 456.27"},e),Ue||(Ue=D.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"})),We||(We=D.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"})));var De=t(7656),Ke=t.n(De);const Ge=({isOpen:e,onClose:t,id:r,upsellLink:o,title:i="",description:n="",benefits:a=[],note:c="",ctbId:d="",modalTitle:p})=>{const{isBlackFriday:m,isWooCommerceActive:h,isProductEntity:g,isWooSEOActive:y}=(0,k.useSelect)(e=>{const s=e("yoast-seo/editor");return{isProductEntity:s.getIsProductEntity(),isWooCommerceActive:s.getIsWooCommerceActive(),isBlackFriday:s.isPromotionActive("black-friday-promotion"),isWooSEOActive:s.getIsWooSeoActive()}},[]),x=(0,l.useMemo)(()=>h&&g,[h,g]),w=(0,l.useRef)(null);return(0,u.jsx)(R.Modal,{isOpen:e,onClose:t,id:r,initialFocus:w,children:(0,u.jsx)(R.Modal.Panel,{className:"yst-max-w-md yst-p-0",hasCloseButton:!1,children:(0,u.jsxs)(R.Modal.Container,{children:[(0,u.jsxs)(R.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,u.jsx)(Ke(),{className:"yst-text-woo-light yst-w-6 yst-h-6 yst-scale-x-[-1]"}):(0,u.jsx)(ze,{className:"yst-fill-primary-500 yst-w-5 yst-h-5"}),(0,u.jsx)(R.Modal.Title,{as:"h3",className:ae()(x?"yst-text-woo-light":"yst-text-primary-500","yst-text-base yst-font-normal"),children:p}),(0,u.jsx)(R.Modal.CloseButton,{className:"yst-top-2",onClick:t,screenReaderText:(0,s.__)("Close modal","wordpress-seo")})]}),(0,u.jsxs)(R.Modal.Container.Content,{className:"yst-p-0",children:[m&&(0,u.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,u.jsx)("div",{className:"yst-mx-auto",children:(0,s.__)("BLACK FRIDAY | 30% OFF","wordpress-seo")})}),(0,u.jsxs)("div",{className:"yst-py-6 yst-px-12",children:[(0,u.jsx)(R.Title,{as:"h3",className:"yst-mb-1 yst-leading-5 yst-text-sm yst-font-medium yst-text-slate-800",children:i}),(0,u.jsx)("p",{className:"yst-mb-2",children:n}),Array.isArray(a)&&a.length>0&&(0,u.jsx)("ul",{className:"yst-my-2",children:a.map((e,s)=>(0,u.jsxs)("li",{className:"yst-flex yst-gap-1 yst-mb-2",children:[(0,u.jsx)(ie(),{className:"yst-mr-1 yst-text-green-500 yst-w-[19.5px] yst-h-[19.5px] yst-flex-shrink-0"}),(0,u.jsx)("p",{className:"yst-text-slate-600",children:e})]},`${r}-upsell-benefit-${s}`))}),"function"==typeof a&&a(),(0,u.jsxs)("div",{className:"yst-text-center",children:[(0,u.jsxs)(R.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":d,ref:w,children:[(0,u.jsx)(F(),{className:"yst-w-4 yst-h-4 yst--ms-1 yst-shrink-0"}),(0,s.sprintf)(/* translators: %s expands to 'Yoast SEO Premium' or 'Yoast Woocommerce SEO'. */ /* translators: %s expands to 'Yoast SEO Premium' or 'Yoast Woocommerce SEO'. */
32 -(0,s.__)("Explore %s","wordpress-seo"),x&&!y?"Yoast WooCommerce SEO":"Yoast SEO Premium"),(0,u.jsx)("span",{className:"yst-sr-only",children:(0,s.__)("Opens in a new tab","wordpress-seo")})]}),(0,u.jsx)("div",{className:"yst-italic yst-text-slate-500 yst-mt-1",children:c})]})]})]})]})})})},Ye=({isOpen:e,closeModal:t,id:r,upsellLink:o})=>{const{locationContext:i}=(0,_.useRootContext)(),n=(0,j.addQueryArgs)(wpseoAdminL10n[o],{context:i}),a=[O((0,s.sprintf)(/* translators: %1$s and %2$s are opening and closing span tags. */ /* translators: %1$s and %2$s are opening and closing span tags. */
33 -(0,s.__)("%1$sKeyphrase distribution:%2$s See if your keywords are spread evenly so search engines understand your topic","wordpress-seo"),"<span>","</span>"),{span:(0,u.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})}),O((0,s.sprintf)(/* translators: %1$s and %2$s are opening and closing span tags. */ /* translators: %1$s and %2$s are opening and closing span tags. */
34 -(0,s.__)("%1$sTitle check:%2$s Instantly spot missing titles and fix them for better click-through rates","wordpress-seo"),"<span>","</span>"),{span:(0,u.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})}),O((0,s.sprintf)(/* translators: %1$s and %2$s are opening and closing span tags. */ /* translators: %1$s and %2$s are opening and closing span tags. */
35 -(0,s.__)("%1$sSynonyms:%2$s Include synonyms of your keyphrase for a more natural flow and smarter suggestions","wordpress-seo"),"<span>","</span>"),{span:(0,u.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})})];return(0,u.jsx)(Ge,{isOpen:e,onClose:t,id:r,modalTitle:(0,s.__)("Get deeper SEO insights with Premium","wordpress-seo"),title:(0,s.__)("Find new ways to grow your rankings.","wordpress-seo"),description:(0,s.__)("Premium gives you advanced content checks that reveal new ranking opportunities and help you reach more readers.","wordpress-seo"),upsellLink:n,benefits:a,note:(0,s.__)("Upgrade to optimize with precision","wordpress-seo"),ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2"})};Ye.propTypes={isOpen:a().bool.isRequired,closeModal:a().func.isRequired,id:a().string.isRequired,upsellLink:a().string.isRequired};class Ve extends l.Component{constructor(e){super(e);const s=this.props.results;this.state={mappedResults:{}},null!==s&&(this.state={mappedResults:Te(s,this.props.keywordKey)}),this.handleMarkButtonClick=this.handleMarkButtonClick.bind(this),this.handleEditButtonClick=this.handleEditButtonClick.bind(this),this.handleResultsChange=this.handleResultsChange.bind(this),this.renderHighlightingUpsell=this.renderHighlightingUpsell.bind(this),this.createMarkButton=this.createMarkButton.bind(this)}componentDidUpdate(e){null!==this.props.results&&this.props.results!==e.results&&this.setState({mappedResults:Te(this.props.results,this.props.keywordKey)})}createMarkButton({ariaLabel:e,id:s,className:t,status:o,onClick:i,isPressed:n}){return(0,u.jsxs)(l.Fragment,{children:[(0,u.jsx)(r.IconButtonToggle,{marksButtonStatus:o,className:t,onClick:i,id:s,icon:"eye",pressed:n,ariaLabel:e}),this.props.shouldUpsellHighlighting&&(0,u.jsx)("div",{className:"yst-root",children:(0,u.jsx)(R.Badge,{className:"yst-absolute yst-px-[3px] yst-py-[3px] yst--end-[6.5px] yst--top-[6.5px]",size:"small",variant:"upsell",children:(0,u.jsx)(qe(),{className:"yst-w-2.5 yst-h-2.5 yst-shrink-0",role:"img","aria-hidden":!0,focusable:!1})})})]})}deactivateMarker(){this.props.setActiveMarker(null),this.props.setMarkerPauseStatus(!1),this.removeMarkers()}activateMarker(e,s){this.props.setActiveMarker(e),s()}handleMarkButtonClick(e,s){const t=this.props.keywordKey.length>0?`${this.props.keywordKey}:${e}`:e;this.props.activeAIFixesButton&&this.props.setActiveAIFixesButton(null),t===this.props.activeMarker?this.deactivateMarker():this.activateMarker(t,s)}handleResultsChange(e,s,t){const r=this.props.keywordKey.length>0?`${this.props.keywordKey}:${e}`:e;r===this.props.activeMarker&&(t?(0,i.isUndefined)(s)||this.activateMarker(r,s):this.deactivateMarker())}focusOnKeyphraseField(e){const s=this.props.keywordKey,t=""===s?"focus-keyword-input-"+e:"yoast-keyword-input-"+s+"-"+e,r=document.getElementById(t);r.focus(),r.scrollIntoView({behavior:"auto",block:"center",inline:"center"})}focusOnGooglePreviewField(e,s){const t=document.getElementById("yoast-google-preview-"+e+"-"+s);t.focus(),t.scrollIntoView({behavior:"auto",block:"center",inline:"center"})}handleEditButtonClick(e,s){var t;null==s||null===(t=s.currentTarget)||void 0===t||t.blur();const r=this.props.location;"keyphrase"!==e?(["description","title","slug"].includes(e)&&this.handleGooglePreviewFocus(r,e),(0,$e.doAction)("yoast.focus.input",e)):this.focusOnKeyphraseField(r)}handleGooglePreviewFocus(e,s){if("sidebar"===e)document.getElementById("yoast-search-appearance-modal-open-button").click(),setTimeout(()=>this.focusOnGooglePreviewField(s,"modal"),500);else{const t=document.getElementById("yoast-snippet-editor-metabox");t&&"false"===t.getAttribute("aria-expanded")?(t.click(),setTimeout(()=>this.focusOnGooglePreviewField(s,e),100)):this.focusOnGooglePreviewField(s,e)}}removeMarkers(){window.YoastSEO.analysis.applyMarks(new Le.Paper("",{}),[])}renderHighlightingUpsell(e,t){const r=(0,s.__)("Highlight areas of improvement in your text, no more searching for a needle in a haystack, straight to optimizing! Now also in Elementor!","wordpress-seo");return(0,u.jsx)(Ye,{isOpen:e,closeModal:t,id:"yoast-premium-seo-analysis-highlighting-modal",upsellLink:this.props.highlightingUpsellLink,description:r})}render(){const{mappedResults:e}=this.state,{errorsResults:t,improvementsResults:r,goodResults:o,considerationsResults:i,problemsResults:n}=e,{upsellResults:a,resultCategoryLabels:c}=this.props,d={errors:(0,s.__)("Errors","wordpress-seo"),problems:(0,s.__)("Problems","wordpress-seo"),improvements:(0,s.__)("Improvements","wordpress-seo"),considerations:(0,s.__)("Considerations","wordpress-seo"),goodResults:(0,s.__)("Good results","wordpress-seo")},p=Object.assign(d,c);let m=this.props.marksButtonStatus;return"enabled"===m&&this.props.shortcodesForParsing.length>0&&(m="disabled"),(0,u.jsx)(l.Fragment,{children:(0,u.jsx)(Be.ContentAnalysis,{errorsResults:t,problemsResults:n,upsellResults:a,improvementsResults:r,considerationsResults:i,goodResults:o,activeMarker:this.props.activeMarker,onMarkButtonClick:this.handleMarkButtonClick,onEditButtonClick:this.handleEditButtonClick,marksButtonClassName:this.props.marksButtonClassName,editButtonClassName:this.props.editButtonClassName,marksButtonStatus:m,headingLevel:3,keywordKey:this.props.keywordKey,id:this.props.id,isPremium:this.props.isPremium,resultCategoryLabels:p,onResultChange:this.handleResultsChange,shouldUpsellHighlighting:this.props.shouldUpsellHighlighting,renderAIOptimizeButton:this.props.renderAIOptimizeButton,renderHighlightingUpsell:this.renderHighlightingUpsell,markButtonFactory:this.createMarkButton})})}}Ve.propTypes={results:a().array,upsellResults:a().array,marksButtonClassName:a().string,editButtonClassName:a().string,marksButtonStatus:a().oneOf(["enabled","disabled","hidden"]),setActiveMarker:a().func.isRequired,setMarkerPauseStatus:a().func.isRequired,setActiveAIFixesButton:a().func.isRequired,activeMarker:a().string,activeAIFixesButton:a().string,keywordKey:a().string,location:a().string,id:a().string,isPremium:a().bool,resultCategoryLabels:a().shape({errors:a().string,problems:a().string,improvements:a().string,considerations:a().string,goodResults:a().string}),shortcodesForParsing:a().array,shouldUpsellHighlighting:a().bool,highlightingUpsellLink:a().string,renderAIOptimizeButton:a().func},Ve.defaultProps={results:null,upsellResults:[],marksButtonStatus:"enabled",marksButtonClassName:"",editButtonClassName:"",activeMarker:null,activeAIFixesButton:null,keywordKey:"",location:"",id:"",isPremium:!1,resultCategoryLabels:{},shortcodesForParsing:[],shouldUpsellHighlighting:!1,highlightingUpsellLink:"",renderAIOptimizeButton:()=>{}};const Ze=Ve,Qe=(0,v.compose)([(0,k.withSelect)(e=>{const{getActiveMarker:s,getIsPremium:t,getShortcodesForParsing:r,getActiveAIFixesButton:o}=e("yoast-seo/editor");return{activeMarker:s(),isPremium:t(),shortcodesForParsing:r(),activeAIFixesButton:o()}}),(0,k.withDispatch)(e=>{const{setActiveMarker:s,setMarkerPauseStatus:t,setActiveAIFixesButton:r}=e("yoast-seo/editor");return{setActiveMarker:s,setMarkerPauseStatus:t,setActiveAIFixesButton:r}})])(Ze);function Je(e){return(0,i.isNil)(e)||(e/=10),function(e){switch(e){case"feedback":return{className:"na",screenReaderText:(0,s.__)("Not available","wordpress-seo"),screenReaderReadabilityText:(0,s.__)("Not available","wordpress-seo"),screenReaderInclusiveLanguageText:(0,s.__)("Not available","wordpress-seo")};case"bad":return{className:"bad",screenReaderText:(0,s.__)("Needs improvement","wordpress-seo"),screenReaderReadabilityText:(0,s.__)("Needs improvement","wordpress-seo"),screenReaderInclusiveLanguageText:(0,s.__)("Needs improvement","wordpress-seo")};case"ok":return{className:"ok",screenReaderText:(0,s.__)("OK SEO score","wordpress-seo"),screenReaderReadabilityText:(0,s.__)("OK","wordpress-seo"),screenReaderInclusiveLanguageText:(0,s.__)("Potentially non-inclusive","wordpress-seo")};case"good":return{className:"good",screenReaderText:(0,s.__)("Good SEO score","wordpress-seo"),screenReaderReadabilityText:(0,s.__)("Good","wordpress-seo"),screenReaderInclusiveLanguageText:(0,s.__)("Good","wordpress-seo")};default:return{className:"loading",screenReaderText:"",screenReaderReadabilityText:"",screenReaderInclusiveLanguageText:""}}}(Le.interpreters.scoreToRating(e))}const Xe=(0,o.makeOutboundLink)(d().a`
20 +`,x=(0,r.getDirectionalStyle)("right: 16px","left: 24px"),w=d().h2`
21 + // wrapInHeading's resets, as longhands so the icon's lane below can override one side.
22 + margin: 0 !important;
23 + padding-block: 0 !important;
24 + padding-inline-start: 0 !important;
25 + font-size: ${e=>e.headingProps.fontSize} !important;
26 + font-weight: ${e=>e.headingProps.fontWeight} !important;
27 + color: ${e=>e.headingProps.color} !important;
28 +
29 + ${o.StyledTitle} {
30 + font-weight: ${e=>e.headingProps.fontWeight};
31 + color: ${e=>e.headingProps.color};
32 + }
33 +
34 + position: relative;
35 + display: flex;
36 + align-items: center;
37 + // The suffix icon's lane, so the title and the link shrink before reaching it.
38 + padding-inline-end: 48px !important;
39 +
40 + &:hover {
41 + background-color: #f0f0f0;
42 + }
43 +
44 + // The link's wrapper, above the button's overlay so the link stays clickable.
45 + > span {
46 + position: relative;
47 + z-index: 1;
48 + flex: 0 0 auto;
49 + }
50 +
51 + ${o.StyledIconsButton} {
52 + flex: 0 1 auto;
53 + min-width: 0;
54 + width: auto;
55 + /*
56 + * Restates the shared h2 > button padding instead of inheriting a selector this heading does not
57 + * own. Physical on purpose: the collapsibles it has to line up with are padded physically too.
58 + */
59 + padding-block-start: 16px;
60 + ${(0,r.getDirectionalStyle)("padding-left: 24px","padding-right: 16px")};
61 + // The help link brings its own leading gap, so the button ends at its title.
62 + padding-inline-end: 0;
63 + // Only the heading paints the hover, so it covers the row in one even color.
64 + background-color: transparent;
65 +
66 + &:hover {
67 + background-color: transparent;
68 + }
69 +
70 + &::after {
71 + content: "";
72 + position: absolute;
73 + inset: 0;
74 + }
75 +
76 + /*
77 + * The ring moves to the overlay, because on the button it would frame the title alone. It cannot
78 + * be reused: elsewhere it is the browser's own, which no pseudo-element can draw. Colors from Button.js.
79 + */
80 + &:focus {
81 + outline: none;
82 + box-shadow: none;
83 + }
84 +
85 + &:focus::after {
86 + outline: 1px solid ${g.colors.$color_blue};
87 + outline-offset: -1px;
88 + box-shadow: 0 0 3px ${(0,g.rgba)(g.colors.$color_blue_dark,.8)};
89 + }
90 +
91 + > svg:last-child {
92 + position: absolute;
93 + ${x};
94 + top: 50%;
95 + transform: translateY(-50%);
96 + margin: 0;
97 + }
98 + }
99 +`,f=({initialIsOpen:e=!1,id:s=null,HeaderHelpLink:t=null,headingProps:r=o.Collapsible.defaultProps.headingProps,...i})=>{const n=(0,l.useRef)(t);n.current=t;const a=(0,l.useRef)(r);a.current=r;const c=Boolean(t),d=(0,l.useMemo)(()=>c?function(e){const s=n.current;return(0,u.jsxs)(w,{headingProps:a.current,children:[(0,u.jsx)(o.StyledIconsButton,{...e}),(0,u.jsx)("span",{children:(0,u.jsx)(s,{})})]})}:null,[c]);return(0,u.jsx)(y,{hasPadding:!0,hasSeparator:!0,initialIsOpen:e,id:s,headingProps:r,...d?{Heading:d}:{},...i})};f.propTypes={initialIsOpen:a().bool,id:a().string,HeaderHelpLink:a().elementType,headingProps:a().shape({level:a().number,fontSize:a().string,fontWeight:a().string,color:a().string})};const b=f,v=({title:e,children:s,id:t=null,prefixIcon:r=null,subTitle:i="",hasBetaBadgeLabel:n=!1,hasNewBadgeLabel:a=!1,buttonId:c=null,renderNewBadgeLabel:d=()=>{},initialIsOpen:p=!1})=>{const[h,m]=(0,l.useState)(p),g=(0,l.useRef)(null);(0,l.useEffect)(()=>{p&&g.current&&g.current.focus()},[]);const y=(0,l.useCallback)(()=>{m(e=>!e)},[m]);return(0,u.jsxs)("div",{id:t,className:"yoast components-panel__body "+(h?"is-opened":""),children:[(0,u.jsx)("h2",{className:"components-panel__body-title",children:(0,u.jsxs)("button",{ref:g,onClick:y,className:"components-button components-panel__body-toggle",type:"button",id:c,children:[(0,u.jsx)("span",{className:"yoast-icon-span",style:{fill:`${r&&r.color||""}`},children:r&&(0,u.jsx)(o.SvgIcon,{icon:r.icon,color:r.color,size:r.size})}),!a&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("span",{className:"yoast-title-container",children:[(0,u.jsx)("div",{className:"yoast-title",children:e}),i&&(0,u.jsx)("div",{className:"yoast-subtitle",children:i})]}),n&&(0,u.jsx)(o.BetaBadge,{})]}),a&&(0,u.jsxs)("div",{className:"yst-flex-grow yst-flex yst-items-center yst-gap-2",children:[(0,u.jsxs)("span",{className:"yst-overflow-x-hidden yst-leading-normal",children:[(0,u.jsx)("div",{className:"yoast-title",children:e}),i&&(0,u.jsx)("div",{className:"yoast-subtitle",children:i})]}),d()]}),(0,u.jsx)("span",{className:"yoast-chevron","aria-hidden":"true"})]})}),h&&s]})},k=v;v.propTypes={title:a().string.isRequired,children:a().oneOfType([a().node,a().arrayOf(a().node)]).isRequired,id:a().string,prefixIcon:a().object,subTitle:a().string,hasBetaBadgeLabel:a().bool,hasNewBadgeLabel:a().bool,buttonId:a().string,renderNewBadgeLabel:a().func,initialIsOpen:a().bool};const j=(0,r.makeOutboundLink)();function _({isCornerstone:t=!0,onChange:n=i.noop,learnMoreUrl:a,location:l=""}){const c="metabox"===l?b:k;return(0,u.jsxs)(c,{id:(0,r.join)(["yoast-cornerstone-collapsible",l]),title:(0,s.__)("Cornerstone content","wordpress-seo"),children:[(0,u.jsxs)(o.HelpText,{children:[(0,s.__)("Cornerstone content should be the most important and extensive articles on your site.","wordpress-seo")+" ",(0,u.jsx)(j,{href:a,children:(0,s.__)("Learn more about Cornerstone Content.","wordpress-seo")})]}),(0,u.jsx)(m,{id:(0,r.join)(["yoast-cornerstone",l]),isEnabled:t,onToggle:n}),(0,u.jsx)(e.Slot,{name:"YoastAfterCornerstoneToggle"})]})}_.propTypes={isCornerstone:a().bool,onChange:a().func,learnMoreUrl:a().string.isRequired,location:a().string};const S=window.wp.compose,C=window.wp.data,R=window.yoast.externals.contexts,E=window.wp.url,L=window.wp.apiFetch;var N=t.n(L);const I=window.yoast.uiLibrary,M=window.yoast.relatedKeyphraseSuggestions;var T=t(2353),A=t.n(T);const P=({isLoggedIn:e=!1,location:t,onModalOpen:o,onLinkClick:r})=>{const i=e?{onClick:o}:{as:"a",href:"https://oauth.semrush.com/oauth2/authorize?ref=1513012826&client_id=yoast&redirect_uri=https%3A%2F%2Foauth.semrush.com%2Foauth2%2Fyoast%2Fsuccess&response_type=code&scope=user.id",onClick:r};return(0,u.jsx)("div",{className:"yoast",children:(0,u.jsxs)(I.Button,{variant:"secondary",id:`yoast-get-related-keyphrases-${t}`,className:"yst-gap-1.5 yst-mt-0",...i,children:[(0,u.jsx)(A(),{className:"yst-w-4 yst-h-4 yst-text-slate-400"}),(0,s.__)("Discover related keyphrases","wordpress-seo"),!e&&(0,u.jsx)("span",{className:"screen-reader-text",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
100 +(0,s.__)("(Opens in a new browser tab)","wordpress-seo")})]})})};P.propTypes={isLoggedIn:a().bool,location:a().string.isRequired,onModalOpen:a().func.isRequired,onLinkClick:a().func.isRequired};class O extends l.Component{constructor(e){super(e),this.onModalOpen=this.onModalOpen.bind(this),this.onLinkClick=this.onLinkClick.bind(this),this.listenToMessages=this.listenToMessages.bind(this)}onModalOpen(){const{keyphrase:e,onOpenWithNoKeyphrase:s,onOpen:t,location:o,newRequest:r,countryCode:i}=this.props;e.trim()?(t(o),r(i,e)):s()}onLinkClick(e){if(e.preventDefault(),!this.props.keyphrase.trim())return void this.props.onOpenWithNoKeyphrase();const s=e.target.href,t=["top="+(window.top.outerHeight/2+window.top.screenY-285),"left="+(window.top.outerWidth/2+window.top.screenX-170),"width=340","height=570","resizable=1","scrollbars=1","status=0"];this.popup&&!this.popup.closed||(this.popup=window.open(s,"SEMrush_login",t.join(","))),this.popup&&this.popup.focus(),window.addEventListener("message",this.listenToMessages,!1)}async listenToMessages(e){const{data:s,source:t,origin:o}=e;"https://oauth.semrush.com"===o&&this.popup===t&&("semrush:oauth:success"===s.type&&(this.popup.close(),window.removeEventListener("message",this.listenToMessages,!1),await this.performAuthenticationRequest(s)),"semrush:oauth:denied"===s.type&&(this.popup.close(),window.removeEventListener("message",this.listenToMessages,!1),this.props.onAuthentication(!1)))}async performAuthenticationRequest(e){try{const s=new URL(e.url).searchParams.get("code"),t=await N()({path:"yoast/v1/semrush/authenticate",method:"POST",data:{code:s}});200===t.status?(this.props.onAuthentication(!0),this.onModalOpen(),this.popup.close()):console.error(t.error)}catch(e){console.error(e.message)}}render(){const{keyphrase:s,location:t,whichModalOpen:o,onClose:r,countryCode:i,learnMoreLink:n,isLoggedIn:a}=this.props,l=new URL("https://www.semrush.com/analytics/keywordoverview/");return l.searchParams.append("q",s),l.searchParams.append("db",i),(0,u.jsxs)(I.Root,{children:[(0,u.jsx)(P,{isLoggedIn:a,location:t,onLinkClick:this.onLinkClick,onModalOpen:this.onModalOpen}),(0,u.jsx)(M.Modal,{isOpen:Boolean(s)&&o===t,onClose:r,insightsLink:l.toString(),learnMoreLink:n,children:(0,u.jsx)(e.Slot,{name:"YoastRelatedKeyphrases"})})]})}}O.propTypes={keyphrase:a().string,location:a().string,whichModalOpen:a().oneOf(["none","metabox","sidebar"]),isLoggedIn:a().bool,onOpen:a().func.isRequired,onOpenWithNoKeyphrase:a().func.isRequired,onClose:a().func.isRequired,onAuthentication:a().func.isRequired,countryCode:a().string,learnMoreLink:a().string,newRequest:a().func.isRequired},O.defaultProps={keyphrase:"",location:"",whichModalOpen:"none",isLoggedIn:!1,countryCode:"en_US",learnMoreLink:""};const B=O,F=(0,S.compose)([(0,C.withSelect)(e=>{const{getSEMrushModalOpen:s,getSEMrushLoginStatus:t,getSEMrushSelectedCountry:o,getPreference:r,selectLinkParams:i,getFocusKeyphrase:n}=e("yoast-seo/editor");return{whichModalOpen:s(),isLoggedIn:t(),countryCode:o(),isRtl:r("isRtl",!1),learnMoreLink:(0,E.addQueryArgs)("https://yoa.st/3-v",i()),keyphrase:n()}}),(0,C.withDispatch)(e=>{const{setSEMrushNoKeyphraseMessage:s,setSEMrushOpenModal:t,setSEMrushDismissModal:o,setSEMrushLoginStatus:r,setSEMrushNewRequest:i}=e("yoast-seo/editor");return{onOpenWithNoKeyphrase:()=>{s()},onOpen:e=>{t(e)},onClose:()=>{o()},onAuthentication:e=>{r(e)},newRequest:(e,s)=>{i(e,s)}}})])(B);function $({location:s}){return(0,u.jsx)(e.Slot,{name:`yoast-synonyms-${s}`})}$.propTypes={location:a().string.isRequired};const q=(e,s)=>{try{return(0,l.createInterpolateElement)(e,s)}catch(s){return console.error("Error in translation for:",e,s),e}};var U=t(6702),W=t.n(U);a().string.isRequired;var H=t(2514),z=t.n(H),D=t(818),K=t.n(D);const G=({learnMoreLink:e,thumbnail:t,wistiaEmbedPermission:o,upsellLink:r,upsellLabel:i=(0,s.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. */ /* translators: %1$s expands to Yoast SEO Premium. */
101 +(0,s.__)("Unlock with %1$s","wordpress-seo"),"Yoast SEO Premium"),newToText:n="Yoast SEO Premium",ctbId:a="f6a84663-465f-4cb5-8ba5-f7a6d72224b2"})=>{const{onClose:l,initialFocus:c}=(0,I.useModalContext)(),d={a:(0,u.jsx)(ce,{href:e,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,u.jsx)(K(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"}),br:(0,u.jsx)("br",{})};return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center",children:[(0,u.jsxs)("div",{className:"yst-relative yst-w-full",children:[(0,u.jsx)(Ce,{videoId:"vun9z1dpfh",thumbnail:t,wistiaEmbedPermission:o}),(0,u.jsx)(I.Badge,{className:"yst-absolute yst-end-4 yst-text-center yst-justify-center",variant:"info",style:{top:"-8px"},children:(0,s.__)("Beta","wordpress-seo")})]}),(0,u.jsx)("div",{className:"yst-mt-6 yst-text-xs yst-font-medium yst-flex yst-flex-col yst-items-center",children:(0,u.jsxs)("span",{className:"yst-introduction-modal-uppercase yst-flex yst-gap-2 yst-items-center",children:[(0,u.jsx)("span",{className:"yst-logo-icon"}),n]})})]}),(0,u.jsxs)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center",children:[(0,u.jsxs)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center",children:[(0,u.jsx)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium",children:(0,s.sprintf)(/* translators: %s: Expands to "Yoast AI" */ /* translators: %s: Expands to "Yoast AI" */
102 +(0,s.__)("Optimize your SEO content with %s","wordpress-seo"),"Yoast AI")}),(0,u.jsx)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm",children:q((0,s.sprintf)(/* translators: %1$s is a break tag; %2$s and %3$s are anchor tags; %4$s is the arrow icon. */ /* translators: %1$s is a break tag; %2$s and %3$s are anchor tags; %4$s is the arrow icon. */
103 +(0,s.__)("Make content editing a breeze! Optimize your SEO content with quick, actionable suggestions at the click of a button.%1$s%2$sLearn more%3$s%4$s","wordpress-seo"),"<br/>","<a>","<ArrowNarrowRightIcon />","</a>"),d)})]}),(0,u.jsx)("div",{className:"yst-w-full yst-flex yst-mt-6",children:(0,u.jsxs)(I.Button,{as:"a",className:"yst-grow",size:"extra-large",variant:"upsell",href:r,target:"_blank",ref:c,"data-action":"load-nfd-ctb","data-ctb-id":a,children:[(0,u.jsx)(z(),{className:"yst--ms-1 yst-me-2 yst-h-5 yst-w-5"}),i,(0,u.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
104 +(0,s.__)("(Opens in a new browser tab)","wordpress-seo")})]})}),(0,u.jsx)(I.Button,{as:"a",className:"yst-mt-4",variant:"tertiary",onClick:l,children:(0,s.__)("Close","wordpress-seo")})]})]})};G.propTypes={learnMoreLink:a().string.isRequired,upsellLink:a().string.isRequired,thumbnail:a().shape({src:a().string.isRequired,width:a().string,height:a().string}).isRequired,wistiaEmbedPermission:a().shape({value:a().bool.isRequired,status:a().string.isRequired,set:a().func.isRequired}).isRequired,upsellLabel:a().string,newToText:a().string,ctbId:a().string};const Y=({handleRefreshClick:e,supportLink:t})=>(0,u.jsxs)("div",{className:"yst-flex yst-gap-2",children:[(0,u.jsx)(I.Button,{onClick:e,children:(0,s.__)("Refresh this page","wordpress-seo")}),(0,u.jsx)(I.Button,{variant:"secondary",as:"a",href:t,target:"_blank",rel:"noopener",children:(0,s.__)("Contact support","wordpress-seo")})]});Y.propTypes={handleRefreshClick:a().func.isRequired,supportLink:a().string.isRequired};const V=({handleRefreshClick:e,supportLink:t})=>(0,u.jsxs)("div",{className:"yst-grid yst-grid-cols-1 yst-gap-y-2",children:[(0,u.jsx)(I.Button,{className:"yst-order-last",onClick:e,children:(0,s.__)("Refresh this page","wordpress-seo")}),(0,u.jsx)(I.Button,{variant:"secondary",as:"a",href:t,target:"_blank",rel:"noopener",children:(0,s.__)("Contact support","wordpress-seo")})]});V.propTypes={handleRefreshClick:a().func.isRequired,supportLink:a().string.isRequired};const Z=({error:e,children:t=null})=>(0,u.jsxs)("div",{role:"alert",className:"yst-max-w-screen-sm yst-p-8 yst-space-y-4",children:[(0,u.jsx)(I.Title,{children:(0,s.__)("Something went wrong. An unexpected error occurred.","wordpress-seo")}),(0,u.jsx)("p",{children:(0,s.__)("We're very sorry, but it seems like the following error has interrupted our application:","wordpress-seo")}),(0,u.jsx)(I.Alert,{variant:"error",children:(null==e?void 0:e.message)||(0,s.__)("Undefined error message.","wordpress-seo")}),(0,u.jsx)("p",{children:(0,s.__)("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]});Z.propTypes={error:a().object.isRequired,children:a().node},Z.VerticalButtons=V,Z.HorizontalButtons=Y;a().string,a().node.isRequired,a().node.isRequired,a().node,a().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 Q=t(1609),X=t.n(Q);const J=window.ReactDOM;var ee,se,te;(se=ee||(ee={})).Pop="POP",se.Push="PUSH",se.Replace="REPLACE",function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(te||(te={})),new Set(["lazy","caseSensitive","path","id","index","children"]),Error;const oe=["post","put","patch","delete"],re=(new Set(oe),["get",...oe]);new Set(re),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred"),Q.Component,Q.startTransition,new Promise(()=>{}),Q.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(e){}var ie,ne,ae,le;new Map,Q.startTransition,J.flushSync,Q.useId,"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,(le=ie||(ie={})).UseScrollRestoration="useScrollRestoration",le.UseSubmit="useSubmit",le.UseSubmitFetcher="useSubmitFetcher",le.UseFetcher="useFetcher",le.useViewTransitionState="useViewTransitionState",(ae=ne||(ne={})).UseFetcher="useFetcher",ae.UseFetchers="useFetchers",ae.UseScrollRestoration="useScrollRestoration",a().string.isRequired,a().string;const ce=({href:e,children:t=null,...o})=>(0,u.jsxs)(I.Link,{target:"_blank",rel:"noopener noreferrer",...o,href:e,children:[t,(0,u.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
105 +(0,s.__)("(Opens in a new browser tab)","wordpress-seo")})]});ce.propTypes={href:a().string.isRequired,children:a().node};var de=t(8738),ue=t.n(de);(0,s.__)("Create optimized SEO titles & meta descriptions in seconds","wordpress-seo"),(0,s.__)("Apply AI suggestions to improve content in 1 click","wordpress-seo"),(0,s.__)("Manage redirects with ease and without extra plugins","wordpress-seo"),(0,s.__)("Optimize pages for multiple keywords with guidance","wordpress-seo"),(0,s.__)("Add product details to help your listings stand out","wordpress-seo"),(0,s.__)("Make sure search engines show the right version of your product page","wordpress-seo"),(0,s.__)("Create optimized SEO titles & meta descriptions with AI","wordpress-seo"),(0,s.__)("Receive clear SEO and readability guidance to optimize your products","wordpress-seo"),(0,s.__)("Generate SEO optimized metadata in seconds with AI","wordpress-seo"),(0,s.__)("Make your articles visible, be seen in Google News","wordpress-seo"),(0,s.__)("Built to get found by search, AI, and real users","wordpress-seo"),(0,s.__)("Easy Local SEO. Show up in Google Maps results","wordpress-seo"),(0,s.__)("Internal links and redirect management, easy","wordpress-seo"),(0,s.__)("Access to friendly help when you need it, day or night","wordpress-seo");var pe=t(2485),he=t.n(pe);var me;function ge(){return ge=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var o in t)({}).hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},ge.apply(null,arguments)}a().string.isRequired,a().object.isRequired,a().func.isRequired,a().bool.isRequired,t(3473);const ye=e=>Q.createElement("svg",ge({xmlns:"http://www.w3.org/2000/svg",fill:"none","aria-hidden":"true",viewBox:"0 0 16 12"},e),me||(me=Q.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"})));a().string.isRequired,a().object,a().func.isRequired,a().bool.isRequired,a().string.isRequired,a().object.isRequired,a().string.isRequired,a().func.isRequired,a().bool.isRequired;var xe=t(5074),we=t.n(xe);a().bool.isRequired,a().func,a().func,a().string.isRequired,a().string.isRequired,a().string.isRequired,a().string.isRequired;const fe=window.yoast.reactHelmet,be="error",ve="loading",ke="error",je="showPlay",_e="askPermission",Se="isPlaying",Ce=({videoId:e,thumbnail:t,wistiaEmbedPermission:o,className:r=""})=>{const[i,n]=(0,l.useState)(o.value?Se:je),a=(0,l.useCallback)(()=>n(Se),[n]),c=(0,l.useCallback)(()=>{o.value?a():n(_e)},[o.value,a,n]),d=(0,l.useCallback)(()=>n(je),[n]),p=(0,l.useCallback)(()=>{o.set(!0),a()},[o.set,a]);return(0,u.jsxs)(u.Fragment,{children:[o.value&&(0,u.jsx)(fe.Helmet,{children:(0,u.jsx)("script",{src:"https://fast.wistia.com/assets/external/E-v1.js",async:!0})}),(0,u.jsxs)("div",{className:he()("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:[i===je&&(0,u.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,u.jsx)("img",{className:"yst-w-full yst-h-auto yst-object-contain",alt:"",loading:"lazy",decoding:"async",...t})}),i===_e&&(0,u.jsxs)("div",{className:"yst-absolute yst-inset-0 yst-flex yst-flex-col yst-items-center yst-justify-center yst-bg-white",children:[(0,u.jsxs)("p",{className:"yst-max-w-xs yst-mx-auto yst-text-center",children:[o.status===ve&&(0,u.jsx)(I.Spinner,{}),o.status!==ve&&(0,s.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. */
106 +(0,s.__)("To see this video, you need to allow %1$s to load embedded videos from %2$s.","wordpress-seo"),"Yoast SEO","Wistia")]}),(0,u.jsxs)("div",{className:"yst-flex yst-mt-6 yst-gap-x-4",children:[(0,u.jsx)(I.Button,{type:"button",variant:"secondary",onClick:d,disabled:o.status===ve,children:(0,s.__)("Deny","wordpress-seo")}),(0,u.jsx)(I.Button,{type:"button",variant:"primary",onClick:p,disabled:o.status===ve,children:(0,s.__)("Allow","wordpress-seo")})]})]}),o.value&&i===Se&&(0,u.jsxs)("div",{className:"yst-absolute yst-w-full yst-h-full yst-top-0 yst-right-0",children:[null===e&&(0,u.jsx)(I.Spinner,{className:"yst-h-full yst-mx-auto"}),null!==e&&(0,u.jsx)("div",{className:`wistia_embed wistia_async_${e} videoFoam=true`})]})]})]})};Ce.propTypes={videoId:a().string.isRequired,thumbnail:a().shape({src:a().string.isRequired,width:a().string,height:a().string}).isRequired,wistiaEmbedPermission:a().shape({value:a().bool.isRequired,status:a().string.isRequired,set:a().func.isRequired}).isRequired,hasPadding:a().bool},t(5687),a().bool.isRequired,a().func.isRequired,a().func,a().string;const Re="yoast-seo/ai-generator",Ee="yoast-seo/editor",Le="google",Ne="social",Ie="twitter",Me="title",Te="description",Ae="post",Pe="term",Oe={post:"title",term:"term_title"},Be=(0,i.mapValues)(Oe,e=>`%%${e}%%`),Fe={idle:"idle",loading:"loading",success:"success",error:"error"},$e="success",qe="error",Ue="abort",We=({children:e})=>(0,u.jsx)("p",{className:"yst-mt-2",children:e});We.propTypes={children:a().node.isRequired};const He=()=>(0,C.useSelect)(e=>{const s=e(Ee);return{commonErrorsLink:s.selectLink("https://yoa.st/ai-common-errors"),supportLink:s.selectAdminLink("?page=wpseo_page_support")}},[]),ze=(0,s.__)("Something went wrong","wordpress-seo"),De=({linkStoreName:e=Ee})=>{const t=(0,C.useSelect)(s=>s(e).selectLink("https://yoa.st/ai-common-errors"),[e]),o=(0,C.useSelect)(s=>s(e).selectAdminLink("?page=wpseo_page_support"),[e]);return(0,u.jsx)(We,{children:q((0,s.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. */
107 +(0,s.__)("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,u.jsx)(ce,{variant:"error",href:t}),a2:(0,u.jsx)(ce,{variant:"error",href:o})})})};De.propTypes={linkStoreName:a().string};const Ke=({linkStoreName:e=Ee,className:s=""})=>(0,u.jsxs)(I.Alert,{variant:"error",className:s,children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:ze}),(0,u.jsx)(De,{linkStoreName:e})]});Ke.propTypes={linkStoreName:a().string,className:a().string};const Ge=(0,s.__)("Not enough content","wordpress-seo"),Ye=()=>{const{commonErrorsLink:e,supportLink:t}=He();return(0,u.jsx)(We,{children:q((0,s.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. */
108 +(0,s.__)("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,u.jsx)(ce,{variant:"error",href:e}),a2:(0,u.jsx)(ce,{variant:"error",href:t})})})},Ve=()=>(0,u.jsxs)(I.Alert,{variant:"error",children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:Ge}),(0,u.jsx)(Ye,{})]}),Ze=(0,s.__)("SEO analysis required","wordpress-seo"),Qe=()=>{const e=(0,C.useSelect)(e=>e(Ee).selectAdminLink("?page=wpseo_page_settings#/site-features#card-wpseo-keyword_analysis_active"),[]);return(0,u.jsx)(We,{children:q((0,s.sprintf)(
109 +/**
110 + * translators:
111 + * %1$s expands to Yoast SEO.
112 + * %2$s and %3$s expand to an opening and closing anchor tag, respectively, that links to the settings page.
113 + * %4$s expands to Yoast AI.
114 + */
115 +/**
116 + * translators:
117 + * %1$s expands to Yoast SEO.
118 + * %2$s and %3$s expand to an opening and closing anchor tag, respectively, that links to the settings page.
119 + * %4$s expands to Yoast AI.
120 + */
121 +(0,s.__)("%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,u.jsx)(ce,{variant:"error",href:e})})})},Xe=(0,s.__)("You've reached the Yoast AI rate limit","wordpress-seo"),Je=()=>{const e=(0,C.useSelect)(e=>e(Ee).selectLink("https://yoa.st/ai-generator-rate-limit-help"),[]);return(0,u.jsx)(We,{children:q((0,s.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. */
122 +(0,s.__)("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,u.jsx)(ce,{variant:"error",href:e})})})},es=()=>(0,u.jsxs)(I.Alert,{variant:"error",children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:Xe}),(0,u.jsx)(Je,{})]}),ss=(0,s.__)("Subscription required","wordpress-seo"),ts=({invalidSubscriptions:e=[]})=>{const{newYoastWooLink:t,activateYoastWooLink:o,newPremiumLink:r,activatePremiumLink:i}=(0,C.useSelect)(e=>{const s=e(Ee);return{newYoastWooLink:s.selectLink("https://yoa.st/ai-generator-new-yoast-woocommerce"),activateYoastWooLink:s.selectLink("https://yoa.st/ai-generator-activate-yoast-woocommerce"),newPremiumLink:s.selectLink("https://yoa.st/ai-generator-new-premium"),activatePremiumLink:s.selectLink("https://yoa.st/ai-generator-activate-premium")}},[]);let n,a,l;return e.includes("Yoast WooCommerce SEO")?(n="Yoast WooCommerce SEO",a=o,l=t):e.includes("Yoast SEO Premium")&&(n="Yoast SEO Premium",a=i,l=r),n?(0,u.jsx)(We,{children:q((0,s.sprintf)(
123 +/**
124 + * translators:
125 + * %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO.
126 + * %2$s expands to MyYoast.
127 + * %3$s and %4$s expand to an opening and closing anchor tag, respectively, to activate your subscription.
128 + * %5$s and %6$s expand to an opening and closing anchor tag, respectively, to get a new subscription.
129 + **/
130 +/**
131 + * translators:
132 + * %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO.
133 + * %2$s expands to MyYoast.
134 + * %3$s and %4$s expand to an opening and closing anchor tag, respectively, to activate your subscription.
135 + * %5$s and %6$s expand to an opening and closing anchor tag, respectively, to get a new subscription.
136 + **/
137 +(0,s.__)("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"),n,"MyYoast","<Activate>","</Activate>","<New>","</New>"),{Activate:(0,u.jsx)(ce,{variant:"error",href:a}),New:(0,u.jsx)(ce,{variant:"error",href:l})})}):(0,u.jsx)(We,{children:q((0,s.sprintf)(
138 +/**
139 + * translators:
140 + * %1$s expands to MyYoast.
141 + * %2$s and %3$s expand to an opening and closing anchor tag, respectively, to activate your subscription.
142 + **/
143 +/**
144 + * translators:
145 + * %1$s expands to MyYoast.
146 + * %2$s and %3$s expand to an opening and closing anchor tag, respectively, to activate your subscription.
147 + **/
148 +(0,s.__)("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,u.jsx)(ce,{variant:"error",href:i})})})};ts.propTypes={invalidSubscriptions:a().arrayOf(a().string)};const os=({invalidSubscriptions:e=[]})=>{const t=(0,C.useSelect)(e=>e(Re).selectBustSubscriptionCacheEndpoint(),[]),{onClose:o}=(0,I.useModalContext)(),r=(0,l.useCallback)(async()=>{try{await N()({path:t,method:"POST",parse:!1})}catch(e){console.error(e)}window.location.reload()},[]);return(0,u.jsxs)(l.Fragment,{children:[(0,u.jsxs)(I.Alert,{variant:"error",children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:ss}),(0,u.jsx)(ts,{invalidSubscriptions:e})]}),(0,u.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,u.jsx)(I.Button,{variant:"secondary",onClick:o,children:(0,s.__)("Close","wordpress-seo")}),(0,u.jsx)(I.Button,{variant:"primary",onClick:r,children:(0,s.__)("Refresh page","wordpress-seo")})]})]})};os.propTypes={invalidSubscriptions:a().arrayOf(a().string)};const rs=(0,s.__)("Connection timeout","wordpress-seo"),is=()=>{const{commonErrorsLink:e,supportLink:t}=He();return(0,u.jsx)(We,{children:q((0,s.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. */
149 +(0,s.__)("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,u.jsx)(ce,{variant:"error",href:e}),a2:(0,u.jsx)(ce,{variant:"error",href:t})})})},ns=()=>(0,u.jsxs)(I.Alert,{variant:"error",children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:rs}),(0,u.jsx)(is,{})]}),as=(0,s.__)("Usage policy violation","wordpress-seo"),ls=()=>{const e=(0,C.useSelect)(e=>e(Ee).selectAdminLink("?page=wpseo_page_support"),[]);return(0,u.jsx)(We,{children:q((0,s.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. */
150 +(0,s.__)("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,u.jsx)(ce,{variant:"error",href:"https://openai.com/policies/usage-policies"}),a2:(0,u.jsx)(ce,{variant:"error",href:e})})})},cs=()=>(0,u.jsxs)(I.Alert,{variant:"error",children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:as}),(0,u.jsx)(ls,{})]}),ds=(0,s.__)("Something went wrong","wordpress-seo"),us=({errorMessage:e=""})=>{const t=(0,C.useSelect)(e=>e(Ee).selectAdminLink("?page=wpseo_page_support"),[]);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(We,{children:(0,s.sprintf)(/* translators: %s is the error response of the request. */ /* translators: %s is the error response of the request. */
151 +(0,s.__)("The request came back with the following error: '%s'.","wordpress-seo"),e)}),(0,u.jsx)(We,{children:q((0,s.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. */
152 +(0,s.__)("Please try again later. If the issue persists, please %1$scontact our support team%2$s.","wordpress-seo"),"<a>","</a>"),{a:(0,u.jsx)(ce,{variant:"error",href:t})})})]})};us.propTypes={errorMessage:a().string};const ps=({errorMessage:e=""})=>(0,u.jsxs)(I.Alert,{variant:"error",children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:ds}),(0,u.jsx)(us,{errorMessage:e})]});ps.propTypes={errorMessage:a().string};const hs=(0,s.__)("Something went wrong","wordpress-seo"),ms=()=>{const e=(0,C.useSelect)(e=>e(Ee).selectAdminLink("plugins.php"),[]);return(0,u.jsx)(We,{children:q((0,s.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. */
153 +(0,s.__)("The version of %1$s is outdated. Please upgrade %1$s %2$shere%3$s!","wordpress-seo"),"Yoast SEO Premium","<a>","</a>"),{a:(0,u.jsx)(ce,{variant:"error",href:e})})})},gs=()=>(0,u.jsxs)(I.Alert,{variant:"error",children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:hs}),(0,u.jsx)(ms,{})]}),ys=({children:e})=>(0,u.jsx)(I.Modal.Description,{as:"div",className:"yst-mt-2 yst-text-sm yst-text-slate-500",children:e}),xs=({children:e})=>(0,u.jsx)("div",{className:"yst-mt-6 yst-flex yst-flex-row yst-justify-end yst-gap-3",children:e}),ws=({onClose:e,...t})=>(0,u.jsx)(I.Button,{variant:"secondary",onClick:e,...t,children:(0,s.__)("Close","wordpress-seo")}),fs=({isOpen:e,title:t,onClose:o=i.noop,children:r})=>{const n=(0,I.useSvgAria)();return(0,u.jsx)(I.Modal,{isOpen:e,onClose:o,children:(0,u.jsx)(I.Modal.Panel,{className:"yst-max-w-lg",closeButtonScreenReaderText:(0,s.__)("Dismiss","wordpress-seo"),children:(0,u.jsxs)("div",{className:"yst-flex yst-items-start yst-gap-4",children:[(0,u.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,u.jsx)(we(),{className:"yst-h-6 yst-w-6 yst-text-red-600",...n})}),(0,u.jsxs)("div",{className:"yst-text-start yst-flex-1 yst-min-w-0",children:[(0,u.jsx)(I.Modal.Title,{className:"yst-text-lg yst-leading-6 yst-font-medium yst-text-slate-900",children:t}),r]})]})})})},bs=({showActions:e=!1,onRetry:t,onClose:o})=>(0,u.jsxs)(xs,{children:[(0,u.jsx)(ws,{onClose:o}),e&&(0,u.jsx)(I.Button,{variant:"primary",onClick:t,children:(0,s.__)("Try again","wordpress-seo")})]});bs.propTypes={showActions:a().bool,onRetry:a().func.isRequired,onClose:a().func.isRequired};const vs=({isOpen:e=!0,showActions:s=!1,onRetry:t=i.noop,onClose:o=i.noop})=>(0,u.jsxs)(fs,{isOpen:e,title:ze,onClose:o,children:[(0,u.jsx)(ys,{children:(0,u.jsx)(De,{})}),(0,u.jsx)(bs,{showActions:s,onRetry:t,onClose:o})]});vs.propTypes={isOpen:a().bool,showActions:a().bool,onRetry:a().func,onClose:a().func};const ks=({isOpen:e=!0,showActions:s=!1,onRetry:t=i.noop,onClose:o=i.noop})=>(0,u.jsxs)(fs,{isOpen:e,title:rs,onClose:o,children:[(0,u.jsx)(ys,{children:(0,u.jsx)(is,{})}),(0,u.jsx)(bs,{showActions:s,onRetry:t,onClose:o})]});ks.propTypes={isOpen:a().bool,showActions:a().bool,onRetry:a().func,onClose:a().func};const js=({errorMessage:e="",isOpen:s=!0,showActions:t=!1,onRetry:o=i.noop,onClose:r=i.noop})=>(0,u.jsxs)(fs,{isOpen:s,title:ds,onClose:r,children:[(0,u.jsx)(ys,{children:(0,u.jsx)(us,{errorMessage:e})}),(0,u.jsx)(bs,{showActions:t,onRetry:o,onClose:r})]});js.propTypes={errorMessage:a().string,isOpen:a().bool,showActions:a().bool,onRetry:a().func,onClose:a().func};const _s=({isOpen:e=!0,onClose:s=i.noop})=>(0,u.jsxs)(fs,{isOpen:e,title:Ge,onClose:s,children:[(0,u.jsx)(ys,{children:(0,u.jsx)(Ye,{})}),(0,u.jsx)(xs,{children:(0,u.jsx)(ws,{onClose:s})})]});_s.propTypes={isOpen:a().bool,onClose:a().func};const Ss=({isOpen:e=!0,onClose:s=i.noop})=>(0,u.jsxs)(fs,{isOpen:e,title:as,onClose:s,children:[(0,u.jsx)(ys,{children:(0,u.jsx)(ls,{})}),(0,u.jsx)(xs,{children:(0,u.jsx)(ws,{onClose:s})})]});Ss.propTypes={isOpen:a().bool,onClose:a().func};const Cs=({isOpen:e=!0,onClose:s=i.noop})=>(0,u.jsxs)(fs,{isOpen:e,title:Xe,onClose:s,children:[(0,u.jsx)(ys,{children:(0,u.jsx)(Je,{})}),(0,u.jsx)(xs,{children:(0,u.jsx)(ws,{onClose:s})})]});Cs.propTypes={isOpen:a().bool,onClose:a().func};const Rs=({isOpen:e=!0,onClose:s=i.noop})=>(0,u.jsxs)(fs,{isOpen:e,title:hs,onClose:s,children:[(0,u.jsx)(ys,{children:(0,u.jsx)(ms,{})}),(0,u.jsx)(xs,{children:(0,u.jsx)(ws,{onClose:s})})]});Rs.propTypes={isOpen:a().bool,onClose:a().func};const Es=({invalidSubscriptions:e=[],isOpen:t=!0,onClose:o=i.noop})=>{const r=(0,C.useSelect)(e=>e(Re).selectBustSubscriptionCacheEndpoint(),[]),n=(0,l.useCallback)(async()=>{try{await N()({path:r,method:"POST",parse:!1})}catch(e){console.error(e)}window.location.reload()},[r]);return(0,u.jsxs)(fs,{isOpen:t,title:ss,onClose:o,children:[(0,u.jsx)(ys,{children:(0,u.jsx)(ts,{invalidSubscriptions:e})}),(0,u.jsxs)(xs,{children:[(0,u.jsx)(ws,{onClose:o}),(0,u.jsx)(I.Button,{variant:"primary",onClick:n,children:(0,s.__)("Refresh page","wordpress-seo")})]})]})};Es.propTypes={invalidSubscriptions:a().arrayOf(a().string),isOpen:a().bool,onClose:a().func};const Ls=({isOpen:e=!0,onClose:t=i.noop})=>{const o=(0,l.useCallback)(()=>window.location.reload(),[]);return(0,u.jsxs)(fs,{isOpen:e,title:Ze,onClose:t,children:[(0,u.jsx)(ys,{children:(0,u.jsx)(Qe,{})}),(0,u.jsxs)(xs,{children:[(0,u.jsx)(ws,{onClose:t}),(0,u.jsx)(I.Button,{variant:"primary",onClick:o,children:(0,s.__)("Refresh page","wordpress-seo")})]})]})};Ls.propTypes={isOpen:a().bool,onClose:a().func};const Ns=(0,s.__)("Yoast AI cannot reach your site","wordpress-seo"),Is=()=>{const{commonErrorsLink:e,supportLink:t}=He();return(0,u.jsx)(We,{children:q((0,s.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. */
154 +(0,s.__)("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,u.jsx)(ce,{variant:"error",href:e}),a2:(0,u.jsx)(ce,{variant:"error",href:t})})})},Ms=({learnMoreUrl:e=""})=>(0,u.jsx)(We,{children:q((0,s.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. */
155 +(0,s.__)("%1$sLearn more about connecting with MyYoast.%2$s","wordpress-seo"),"<a>","</a>"),{a:(0,u.jsx)(ce,{variant:"error",href:e})})});Ms.propTypes={learnMoreUrl:a().string};const Ts=()=>{const e=(0,I.useSvgAria)(),{commonErrorsLink:t,supportLink:o}=(0,C.useSelect)(e=>{const s=e(Ee);return{commonErrorsLink:s.selectLink("https://yoa.st/ai-common-errors"),supportLink:s.selectAdminLink("?page=wpseo_page_support")}},[]);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ys,{children:(0,u.jsx)(We,{children:(0,s.__)("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,u.jsxs)(xs,{children:[(0,u.jsxs)(I.Button,{as:"a",href:o,target:"_blank",rel:"noopener noreferrer",variant:"secondary",children:[(0,s.__)("Still need help?","wordpress-seo"),(0,u.jsx)(W(),{className:"yst--me-1 yst-ms-1 yst-h-4 yst-w-4 yst-text-slate-400 rtl:yst-rotate-[270deg]",...e}),(0,u.jsx)("span",{className:"yst-sr-only",children:(0,s.__)("(Opens in a new browser tab)","wordpress-seo")})]}),(0,u.jsxs)(I.Button,{as:"a",href:t,target:"_blank",rel:"noopener noreferrer",variant:"primary",children:[(0,s.__)("Learn more","wordpress-seo"),(0,u.jsx)(K(),{className:"yst--me-1 yst-ms-1 yst-h-4 yst-w-4 rtl:yst-rotate-180",...e})]})]})]})},As=({isAvailable:e,canConnect:t,connectUrl:o,learnMoreUrl:r},i,n)=>e&&t&&o?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(ys,{children:[(0,u.jsx)(We,{children:(0,s.__)("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,u.jsx)(Ms,{learnMoreUrl:r})]}),(0,u.jsxs)(xs,{children:[(0,u.jsx)(ws,{onClose:i}),(0,u.jsxs)(I.Button,{as:"a",href:o,target:"_blank",rel:"noopener noreferrer",variant:"primary",children:[(0,s.__)("Connect to MyYoast","wordpress-seo"),(0,u.jsx)(W(),{className:"yst--me-1 yst-ms-1 yst-h-4 yst-w-4 rtl:yst-rotate-[270deg]",...n}),(0,u.jsx)("span",{className:"yst-sr-only",children:(0,s.__)("(Opens in a new browser tab)","wordpress-seo")})]})]})]}):e&&!t?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(ys,{children:[(0,u.jsx)(We,{children:(0,s.__)("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,u.jsx)(Ms,{learnMoreUrl:r})]}),(0,u.jsx)(xs,{children:(0,u.jsx)(ws,{onClose:i})})]}):(0,u.jsx)(Ts,{}),Ps=({isOpen:e=!0,onClose:s=i.noop})=>{const t=(0,I.useSvgAria)(),o=(0,C.useSelect)(e=>e(Re).selectMyyoastConnection(),[]);return(0,u.jsx)(fs,{isOpen:e,title:Ns,onClose:s,children:As(o,s,t)})};Ps.propTypes={isOpen:a().bool,onClose:a().func};const Os=({onGiveConsent:e,learnMoreLink:t,privacyPolicyLink:o,termsOfServiceLink:r,imageLink:i,linkStoreName:n})=>{const{onClose:a,initialFocus:c}=(0,I.useModalContext)(),[d,p]=(0,I.useToggleState)(!1),[h,m]=(0,l.useState)(!1),g=(0,l.useMemo)(()=>({src:i,width:"432",height:"244"}),[i]),y=q((0,s.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. */
156 +(0,s.__)("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,u.jsx)(ce,{href:r}),a2:(0,u.jsx)(ce,{href:o})}),[x,w]=(0,I.useToggleState)(!1),f=(0,l.useCallback)(async()=>{w();const s=await e();m(!1===s),w()},[e]);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center",children:(0,u.jsx)("div",{className:"yst-relative yst-w-full",children:(0,u.jsx)("img",{className:"yst-w-full yst-h-auto yst-rounded-md yst-drop-shadow-md",alt:"",loading:"lazy",decoding:"async",...g})})}),(0,u.jsxs)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center",children:[(0,u.jsxs)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center",children:[(0,u.jsx)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium",children:(0,s.sprintf)(/* translators: %s expands to Yoast AI. */ /* translators: %s expands to Yoast AI. */
157 +(0,s.__)("Grant consent for %s","wordpress-seo"),"Yoast AI")}),(0,u.jsx)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm",children:q((0,s.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. */
158 +(0,s.__)("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,u.jsx)(ce,{href:t,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,u.jsx)(K(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"}),br:(0,u.jsx)("br",{})})})]}),(0,u.jsx)("div",{className:"yst-flex yst-w-full yst-mt-6",children:(0,u.jsx)("hr",{className:"yst-w-full yst-text-gray-200"})}),(0,u.jsxs)("div",{className:"yst-flex yst-items-start yst-mt-4",children:[(0,u.jsx)("input",{type:"checkbox",id:"yst-ai-consent-checkbox",name:"yst-ai-consent-checkbox",checked:d,value:d?"true":"false",onChange:p,className:"yst-checkbox__input",ref:c}),(0,u.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})]}),h&&(0,u.jsx)(Ke,{className:"yst-mt-3",linkStoreName:n}),(0,u.jsx)("div",{className:"yst-w-full yst-flex yst-mt-4",children:(0,u.jsxs)(I.Button,{as:"button",className:"yst-grow",size:"large",disabled:!d||h,onClick:f,children:[x&&!h&&(0,u.jsx)(I.Spinner,{className:"yst-me-2"}),(0,s.__)("Grant consent","wordpress-seo")]})}),(0,u.jsx)(I.Button,{as:"button",className:"yst-mt-4",variant:"tertiary",onClick:a,children:(0,s.__)("Close","wordpress-seo")})]})]})};Os.propTypes={onGiveConsent:a().func.isRequired,learnMoreLink:a().string.isRequired,privacyPolicyLink:a().string.isRequired,termsOfServiceLink:a().string.isRequired,imageLink:a().string.isRequired,linkStoreName:a().string.isRequired};const Bs={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"},Fs=({storeName:e,onConsentGranted:s,linkStoreName:t,links:o={}})=>{const r=(0,l.useMemo)(()=>({...Bs,...o}),[o]),{termsOfServiceLink:i,privacyPolicyLink:n,learnMoreLink:a,imageLink:c,endpoint:d}=(0,C.useSelect)(s=>{const o=s(t),i=s(e);return{termsOfServiceLink:o.selectLink(r.termsOfService),privacyPolicyLink:o.selectLink(r.privacyPolicy),learnMoreLink:o.selectLink(r.learnMore),imageLink:o.selectImageLink("ai-consent.jpg"),endpoint:i.selectAiGeneratorConsentEndpoint()}},[t,e,r]),{storeAiGeneratorConsent:p}=(0,C.useDispatch)(e),h=(0,l.useCallback)(async()=>{const e=await p(!0,d);return!1!==e&&s(),e},[p,s,d]);return(0,u.jsx)(Os,{termsOfServiceLink:i,privacyPolicyLink:n,learnMoreLink:a,imageLink:c,onGiveConsent:h,linkStoreName:t})};Fs.propTypes={storeName:a().string.isRequired,onConsentGranted:a().func.isRequired,linkStoreName:a().string.isRequired,links:a().shape({termsOfService:a().string,privacyPolicy:a().string,learnMore:a().string})};const $s=({location:e,keyword:t,handleChange:o,onFocusKeyword:r,onBlurKeyword:i,validation:n=null})=>(0,u.jsx)(I.TextField,{id:`focus-keyword-input-${e}`,label:(0,s.__)("Focus keyphrase","wordpress-seo"),value:t,onChange:o,onFocus:r,onBlur:i,validation:n,autoComplete:"off",placeholder:(0,s.__)("Type here","wordpress-seo"),description:q((0,s.sprintf)(/* translators: %1$s and %2$s are anchor tags. */ /* translators: %1$s and %2$s are anchor tags. */
159 +(0,s.__)("Use the main word or phrase you want your content found for across search, AI, and beyond. %1$sLearn more about best practices for keyphrases.%2$s","wordpress-seo"),"<a>","</a>"),{a:(0,u.jsx)(ce,{href:wpseoAdminL10n["shortlinks.focus_keyword_info"],variant:"default"})})});$s.propTypes={location:a().string.isRequired,keyword:a().string.isRequired,handleChange:a().func.isRequired,onFocusKeyword:a().func.isRequired,onBlurKeyword:a().func.isRequired,validation:a().shape({variant:a().string,message:a().node})};const qs=e=>`YoastAfterKeywordInput${e.charAt(0).toUpperCase()+e.slice(1)}`,Us=(e,s,t)=>e?(0,u.jsx)(F,{location:s,keyphrase:t}):null,Ws=({keyword:t="",onFocusKeywordChange:o,onFocusKeyword:r,onBlurKeyword:i,isSEMrushIntegrationActive:n=!1,displayNoKeyphraseMessage:a=!1,displayNoKeyphrasForTrackingMessage:c=!1,errors:d=[]})=>{const p=(0,l.useContext)(R.LocationContext),h=(e=>"metabox"===e?b:k)(p),m=(0,l.useCallback)(e=>o(e.target.value),[o]),g=((e,t,o,r)=>{const i=(({errors:e,keyword:t,displayNoKeyphraseMessage:o,displayNoKeyphrasForTrackingMessage:r})=>{const i=0===t.trim().length;return[...e,...[{condition:i&&o,message:(0,s.__)("Please enter a focus keyphrase first to get related keyphrases","wordpress-seo")},{condition:i&&r,message:(0,s.__)("Please enter a focus keyphrase first to track keyphrase performance","wordpress-seo")},{condition:t.includes(","),message:(0,s.__)("Are you trying to use multiple keyphrases? You should add them separately below.","wordpress-seo")},{condition:t.length>191,message:(0,s.__)("Your keyphrase is too long. It can be a maximum of 191 characters.","wordpress-seo")}].filter(({condition:e})=>e).map(({message:e})=>e)]})({errors:e,keyword:t,displayNoKeyphraseMessage:o,displayNoKeyphrasForTrackingMessage:r});return i.length>0?{variant:"error",message:i.map((e,s)=>(0,u.jsx)("span",{role:"alert",className:"yst-block",children:e},s))}:null})(d,t,a,c);return(0,u.jsxs)(h,{id:`yoast-focus-keyphrase-collapsible-${p}`,buttonId:`yoast-focus-keyphrase-collapsible-button-${p}`,title:(0,s.__)("Focus keyphrase","wordpress-seo"),initialIsOpen:!0,children:[(0,u.jsxs)("div",{className:"yst-root yst-space-y-4",children:[(0,u.jsx)($s,{location:p,keyword:t,handleChange:m,onFocusKeyword:r,onBlurKeyword:i,validation:g}),(0,u.jsx)($,{location:p}),Us(n,p,t)]}),(0,u.jsx)(e.Slot,{name:qs(p)})]})};Ws.propTypes={keyword:a().string,onFocusKeywordChange:a().func.isRequired,onFocusKeyword:a().func.isRequired,onBlurKeyword:a().func.isRequired,isSEMrushIntegrationActive:a().bool,displayNoKeyphraseMessage:a().bool,displayNoKeyphrasForTrackingMessage:a().bool,errors:a().arrayOf(a().string)};const Hs=(0,S.compose)([(0,C.withSelect)(e=>{const{getFocusKeyphrase:s,getSEMrushNoKeyphraseMessage:t,hasWincherNoKeyphrase:o,getFocusKeyphraseErrors:r}=e("yoast-seo/editor");return{keyword:s(),displayNoKeyphraseMessage:t(),displayNoKeyphrasForTrackingMessage:o(),errors:r()}}),(0,C.withDispatch)(e=>{const{setFocusKeyword:s,setMarkerPauseStatus:t}=e("yoast-seo/editor");return{onFocusKeywordChange:s,onFocusKeyword:()=>t(!0),onBlurKeyword:()=>t(!1)}})])(Ws);function zs(e){return zs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zs(e)}function Ds(e,s,t){return(s=function(e){var s=function(e){if("object"!=zs(e)||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var t=s.call(e,"string");if("object"!=zs(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==zs(s)?s:s+""}(s))in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}const Ks=window.yoast.analysis;function Gs(e,s=""){const t=e.getIdentifier(),o={score:e.score,rating:Ks.interpreters.scoreToRating(e.score),hasMarks:e.hasMarks(),marker:e.getMarker(),id:t,text:e.text,markerId:s.length>0?`${s}:${t}`:t,hasBetaBadge:e.isBeta(),hasJumps:e.hasJumps(),hasAIFixes:e.isOptimizable(),editFieldName:e.editFieldName,editFieldAriaLabel:e.editFieldAriaLabel};return"ok"===o.rating&&(o.rating="OK"),o}function Ys(e,s){switch(e.rating){case"error":s.errorsResults.push(e);break;case"feedback":s.considerationsResults.push(e);break;case"bad":s.problemsResults.push(e);break;case"OK":s.improvementsResults.push(e);break;case"good":s.goodResults.push(e)}return s}function Vs(e){switch(e){case"loading":return{icon:"loading-spinner",color:g.colors.$color_green_medium_light};case"not-set":return{icon:"seo-score-none",color:g.colors.$color_score_icon};case"noindex":return{icon:"seo-score-none",color:g.colors.$color_noindex};case"good":return{icon:"seo-score-good",color:g.colors.$color_green_medium};case"ok":return{icon:"seo-score-ok",color:g.colors.$color_ok};default:return{icon:"seo-score-bad",color:g.colors.$color_red}}}function Zs(e,s=""){let t={errorsResults:[],problemsResults:[],improvementsResults:[],goodResults:[],considerationsResults:[]};if(!e)return t;for(let o=0;o<e.length;o++){const r=e[o];r.text&&(t=Ys(Gs(r,s),t))}return t}function Qs({target:e,children:s}){let t=e;return"string"==typeof e&&(t=document.getElementById(e)),t?(0,l.createPortal)(s,t):null}Qs.propTypes={target:a().oneOfType([a().string,a().object]).isRequired,children:a().node.isRequired};const Xs=({target:e,scoreIndicator:s})=>(0,u.jsx)(Qs,{target:e,children:(0,u.jsx)(o.SvgIcon,{...Vs(s)})});Xs.propTypes={target:a().string.isRequired,scoreIndicator:a().string.isRequired};const Js=Xs,et=window.yoast.analysisReport;var st=t(465),tt=t.n(st);const ot=window.wp.hooks;var rt,it;function nt(){return nt=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var o in t)({}).hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},nt.apply(null,arguments)}const at=e=>Q.createElement("svg",nt({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 425 456.27"},e),rt||(rt=Q.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"})),it||(it=Q.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"})));var lt=t(7656),ct=t.n(lt);const dt=({isOpen:e,onClose:t,id:o,upsellLink:r,title:i="",description:n="",benefits:a=[],note:c="",ctbId:d="",modalTitle:p})=>{const{isBlackFriday:h,isWooCommerceActive:m,isProductEntity:g,isWooSEOActive:y}=(0,C.useSelect)(e=>{const s=e("yoast-seo/editor");return{isProductEntity:s.getIsProductEntity(),isWooCommerceActive:s.getIsWooCommerceActive(),isBlackFriday:s.isPromotionActive("black-friday-promotion"),isWooSEOActive:s.getIsWooSeoActive()}},[]),x=(0,l.useMemo)(()=>m&&g,[m,g]),w=(0,l.useRef)(null);return(0,u.jsx)(I.Modal,{isOpen:e,onClose:t,id:o,initialFocus:w,children:(0,u.jsx)(I.Modal.Panel,{className:"yst-max-w-md yst-p-0",hasCloseButton:!1,children:(0,u.jsxs)(I.Modal.Container,{children:[(0,u.jsxs)(I.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,u.jsx)(ct(),{className:"yst-text-woo-light yst-w-6 yst-h-6 yst-scale-x-[-1]"}):(0,u.jsx)(at,{className:"yst-fill-primary-500 yst-w-5 yst-h-5"}),(0,u.jsx)(I.Modal.Title,{as:"h3",className:he()(x?"yst-text-woo-light":"yst-text-primary-500","yst-text-base yst-font-normal"),children:p}),(0,u.jsx)(I.Modal.CloseButton,{className:"yst-top-2",onClick:t,screenReaderText:(0,s.__)("Close modal","wordpress-seo")})]}),(0,u.jsxs)(I.Modal.Container.Content,{className:"yst-p-0",children:[h&&(0,u.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,u.jsx)("div",{className:"yst-mx-auto",children:(0,s.__)("BLACK FRIDAY | 30% OFF","wordpress-seo")})}),(0,u.jsxs)("div",{className:"yst-py-6 yst-px-12",children:[(0,u.jsx)(I.Title,{as:"h3",className:"yst-mb-1 yst-leading-5 yst-text-sm yst-font-medium yst-text-slate-800",children:i}),(0,u.jsx)("p",{className:"yst-mb-2",children:n}),Array.isArray(a)&&a.length>0&&(0,u.jsx)("ul",{className:"yst-my-2",children:a.map((e,s)=>(0,u.jsxs)("li",{className:"yst-flex yst-gap-1 yst-mb-2",children:[(0,u.jsx)(ue(),{className:"yst-mr-1 yst-text-green-500 yst-w-[19.5px] yst-h-[19.5px] yst-flex-shrink-0"}),(0,u.jsx)("p",{className:"yst-text-slate-600",children:e})]},`${o}-upsell-benefit-${s}`))}),"function"==typeof a&&a(),(0,u.jsxs)("div",{className:"yst-text-center",children:[(0,u.jsxs)(I.Button,{as:"a",variant:"upsell",className:"yst-my-2 yst-gap-1.5 yst-w-full",href:r,target:"_blank","data-action":"load-nfd-ctb","data-ctb-id":d,ref:w,children:[(0,u.jsx)(z(),{className:"yst-w-4 yst-h-4 yst--ms-1 yst-shrink-0"}),(0,s.sprintf)(/* translators: %s expands to 'Yoast SEO Premium' or 'Yoast Woocommerce SEO'. */ /* translators: %s expands to 'Yoast SEO Premium' or 'Yoast Woocommerce SEO'. */
160 +(0,s.__)("Explore %s","wordpress-seo"),x&&!y?"Yoast WooCommerce SEO":"Yoast SEO Premium"),(0,u.jsx)("span",{className:"yst-sr-only",children:(0,s.__)("Opens in a new tab","wordpress-seo")})]}),(0,u.jsx)("div",{className:"yst-italic yst-text-slate-500 yst-mt-1",children:c})]})]})]})]})})})},ut=({isOpen:e,closeModal:t,id:o,upsellLink:r})=>{const{locationContext:i}=(0,R.useRootContext)(),n=(0,E.addQueryArgs)(wpseoAdminL10n[r],{context:i}),a=[q((0,s.sprintf)(/* translators: %1$s and %2$s are opening and closing span tags. */ /* translators: %1$s and %2$s are opening and closing span tags. */
161 +(0,s.__)("%1$sKeyphrase distribution:%2$s See if your keywords are spread evenly so search engines understand your topic","wordpress-seo"),"<span>","</span>"),{span:(0,u.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})}),q((0,s.sprintf)(/* translators: %1$s and %2$s are opening and closing span tags. */ /* translators: %1$s and %2$s are opening and closing span tags. */
162 +(0,s.__)("%1$sTitle check:%2$s Instantly spot missing titles and fix them for better click-through rates","wordpress-seo"),"<span>","</span>"),{span:(0,u.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})}),q((0,s.sprintf)(/* translators: %1$s and %2$s are opening and closing span tags. */ /* translators: %1$s and %2$s are opening and closing span tags. */
163 +(0,s.__)("%1$sSynonyms:%2$s Include synonyms of your keyphrase for a more natural flow and smarter suggestions","wordpress-seo"),"<span>","</span>"),{span:(0,u.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})})];return(0,u.jsx)(dt,{isOpen:e,onClose:t,id:o,modalTitle:(0,s.__)("Get deeper SEO insights with Premium","wordpress-seo"),title:(0,s.__)("Find new ways to grow your rankings.","wordpress-seo"),description:(0,s.__)("Premium gives you advanced content checks that reveal new ranking opportunities and help you reach more readers.","wordpress-seo"),upsellLink:n,benefits:a,note:(0,s.__)("Upgrade to optimize with precision","wordpress-seo"),ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2"})};ut.propTypes={isOpen:a().bool.isRequired,closeModal:a().func.isRequired,id:a().string.isRequired,upsellLink:a().string.isRequired};class pt extends l.Component{constructor(e){super(e);const s=this.props.results;this.state={mappedResults:{}},null!==s&&(this.state={mappedResults:Zs(s,this.props.keywordKey)}),this.handleMarkButtonClick=this.handleMarkButtonClick.bind(this),this.handleEditButtonClick=this.handleEditButtonClick.bind(this),this.handleResultsChange=this.handleResultsChange.bind(this),this.renderHighlightingUpsell=this.renderHighlightingUpsell.bind(this),this.createMarkButton=this.createMarkButton.bind(this)}componentDidUpdate(e){null!==this.props.results&&this.props.results!==e.results&&this.setState({mappedResults:Zs(this.props.results,this.props.keywordKey)})}createMarkButton({ariaLabel:e,id:s,className:t,status:r,onClick:i,isPressed:n}){return(0,u.jsxs)(l.Fragment,{children:[(0,u.jsx)(o.IconButtonToggle,{marksButtonStatus:r,className:t,onClick:i,id:s,icon:"eye",pressed:n,ariaLabel:e}),this.props.shouldUpsellHighlighting&&(0,u.jsx)("div",{className:"yst-root",children:(0,u.jsx)(I.Badge,{className:"yst-absolute yst-px-[3px] yst-py-[3px] yst--end-[6.5px] yst--top-[6.5px]",size:"small",variant:"upsell",children:(0,u.jsx)(tt(),{className:"yst-w-2.5 yst-h-2.5 yst-shrink-0",role:"img","aria-hidden":!0,focusable:!1})})})]})}deactivateMarker(){this.props.setActiveMarker(null),this.props.setMarkerPauseStatus(!1),this.removeMarkers()}activateMarker(e,s){this.props.setActiveMarker(e),s()}handleMarkButtonClick(e,s){const t=this.props.keywordKey.length>0?`${this.props.keywordKey}:${e}`:e;this.props.activeAIFixesButton&&this.props.setActiveAIFixesButton(null),t===this.props.activeMarker?this.deactivateMarker():this.activateMarker(t,s)}handleResultsChange(e,s,t){const o=this.props.keywordKey.length>0?`${this.props.keywordKey}:${e}`:e;o===this.props.activeMarker&&(t?(0,i.isUndefined)(s)||this.activateMarker(o,s):this.deactivateMarker())}focusOnKeyphraseField(e){const s=this.props.keywordKey,t=""===s?"focus-keyword-input-"+e:"yoast-keyword-input-"+s+"-"+e,o=document.getElementById(t);o.focus(),o.scrollIntoView({behavior:"auto",block:"center",inline:"center"})}focusOnGooglePreviewField(e,s){const t=document.getElementById("yoast-google-preview-"+e+"-"+s);t.focus(),t.scrollIntoView({behavior:"auto",block:"center",inline:"center"})}handleEditButtonClick(e,s){var t;null==s||null===(t=s.currentTarget)||void 0===t||t.blur();const o=this.props.location;"keyphrase"!==e?(["description","title","slug"].includes(e)&&this.handleGooglePreviewFocus(o,e),(0,ot.doAction)("yoast.focus.input",e)):this.focusOnKeyphraseField(o)}handleGooglePreviewFocus(e,s){if("sidebar"===e)document.getElementById("yoast-search-appearance-modal-open-button").click(),setTimeout(()=>this.focusOnGooglePreviewField(s,"modal"),500);else{const t=document.getElementById("yoast-snippet-editor-metabox");t&&"false"===t.getAttribute("aria-expanded")?(t.click(),setTimeout(()=>this.focusOnGooglePreviewField(s,e),100)):this.focusOnGooglePreviewField(s,e)}}removeMarkers(){window.YoastSEO.analysis.applyMarks(new Ks.Paper("",{}),[])}renderHighlightingUpsell(e,t){const o=(0,s.__)("Highlight areas of improvement in your text, no more searching for a needle in a haystack, straight to optimizing! Now also in Elementor!","wordpress-seo");return(0,u.jsx)(ut,{isOpen:e,closeModal:t,id:"yoast-premium-seo-analysis-highlighting-modal",upsellLink:this.props.highlightingUpsellLink,description:o})}render(){const{mappedResults:e}=this.state,{errorsResults:t,improvementsResults:o,goodResults:r,considerationsResults:i,problemsResults:n}=e,{upsellResults:a,resultCategoryLabels:c}=this.props,d={errors:(0,s.__)("Errors","wordpress-seo"),problems:(0,s.__)("Problems","wordpress-seo"),improvements:(0,s.__)("Improvements","wordpress-seo"),considerations:(0,s.__)("Considerations","wordpress-seo"),goodResults:(0,s.__)("Good results","wordpress-seo")},p=Object.assign(d,c);let h=this.props.marksButtonStatus;return"enabled"===h&&this.props.shortcodesForParsing.length>0&&(h="disabled"),(0,u.jsx)(l.Fragment,{children:(0,u.jsx)(et.ContentAnalysis,{errorsResults:t,problemsResults:n,upsellResults:a,improvementsResults:o,considerationsResults:i,goodResults:r,activeMarker:this.props.activeMarker,onMarkButtonClick:this.handleMarkButtonClick,onEditButtonClick:this.handleEditButtonClick,marksButtonClassName:this.props.marksButtonClassName,editButtonClassName:this.props.editButtonClassName,marksButtonStatus:h,headingLevel:3,keywordKey:this.props.keywordKey,id:this.props.id,isPremium:this.props.isPremium,resultCategoryLabels:p,onResultChange:this.handleResultsChange,shouldUpsellHighlighting:this.props.shouldUpsellHighlighting,renderAIOptimizeButton:this.props.renderAIOptimizeButton,renderHighlightingUpsell:this.renderHighlightingUpsell,markButtonFactory:this.createMarkButton})})}}pt.propTypes={results:a().array,upsellResults:a().array,marksButtonClassName:a().string,editButtonClassName:a().string,marksButtonStatus:a().oneOf(["enabled","disabled","hidden"]),setActiveMarker:a().func.isRequired,setMarkerPauseStatus:a().func.isRequired,setActiveAIFixesButton:a().func.isRequired,activeMarker:a().string,activeAIFixesButton:a().string,keywordKey:a().string,location:a().string,id:a().string,isPremium:a().bool,resultCategoryLabels:a().shape({errors:a().string,problems:a().string,improvements:a().string,considerations:a().string,goodResults:a().string}),shortcodesForParsing:a().array,shouldUpsellHighlighting:a().bool,highlightingUpsellLink:a().string,renderAIOptimizeButton:a().func},pt.defaultProps={results:null,upsellResults:[],marksButtonStatus:"enabled",marksButtonClassName:"",editButtonClassName:"",activeMarker:null,activeAIFixesButton:null,keywordKey:"",location:"",id:"",isPremium:!1,resultCategoryLabels:{},shortcodesForParsing:[],shouldUpsellHighlighting:!1,highlightingUpsellLink:"",renderAIOptimizeButton:()=>{}};const ht=pt,mt=(0,S.compose)([(0,C.withSelect)(e=>{const{getActiveMarker:s,getIsPremium:t,getShortcodesForParsing:o,getActiveAIFixesButton:r}=e("yoast-seo/editor");return{activeMarker:s(),isPremium:t(),shortcodesForParsing:o(),activeAIFixesButton:r()}}),(0,C.withDispatch)(e=>{const{setActiveMarker:s,setMarkerPauseStatus:t,setActiveAIFixesButton:o}=e("yoast-seo/editor");return{setActiveMarker:s,setMarkerPauseStatus:t,setActiveAIFixesButton:o}})])(ht);function gt(e){return(0,i.isNil)(e)||(e/=10),function(e){switch(e){case"feedback":return{className:"na",screenReaderText:(0,s.__)("Not available","wordpress-seo"),screenReaderReadabilityText:(0,s.__)("Not available","wordpress-seo"),screenReaderInclusiveLanguageText:(0,s.__)("Not available","wordpress-seo")};case"bad":return{className:"bad",screenReaderText:(0,s.__)("Needs improvement","wordpress-seo"),screenReaderReadabilityText:(0,s.__)("Needs improvement","wordpress-seo"),screenReaderInclusiveLanguageText:(0,s.__)("Needs improvement","wordpress-seo")};case"ok":return{className:"ok",screenReaderText:(0,s.__)("OK SEO score","wordpress-seo"),screenReaderReadabilityText:(0,s.__)("OK","wordpress-seo"),screenReaderInclusiveLanguageText:(0,s.__)("Potentially non-inclusive","wordpress-seo")};case"good":return{className:"good",screenReaderText:(0,s.__)("Good SEO score","wordpress-seo"),screenReaderReadabilityText:(0,s.__)("Good","wordpress-seo"),screenReaderInclusiveLanguageText:(0,s.__)("Good","wordpress-seo")};default:return{className:"loading",screenReaderText:"",screenReaderReadabilityText:"",screenReaderInclusiveLanguageText:""}}}(Ks.interpreters.scoreToRating(e))}const yt=(0,r.makeOutboundLink)(d().a`
36 164 display: inline-block;
37 165 position: relative;
38 166 outline: none;
39 167 text-decoration: none;
@@ -42,18 +170,18 @@
42 170 height: 24px;
43 171 margin: -4px 0;
44 172 vertical-align: middle;
45 173
46 - color: ${Ee.colors.$color_help_text};
174 + color: ${g.colors.$color_help_text};
47 175
48 176 &:hover,
49 177 &:focus {
50 - color: ${Ee.colors.$color_snippet_focus};
178 + color: ${g.colors.$color_snippet_focus};
51 179 }
52 180
53 181 // Overwrite the default blue active color for links.
54 182 &:active {
55 - color: ${Ee.colors.$color_help_text};
183 + color: ${g.colors.$color_help_text};
56 184 }
57 185
58 186 &::before {
59 187 position: absolute;
@@ -61,58 +189,20 @@
61 189 left: 0;
62 190 padding: 2px;
63 191 content: "\f223";
64 192 }
65 -`);function es({target:e,children:s}){return(0,u.jsx)(Pe,{target:e,children:s})}function ss(){return(0,i.get)(window,"wpseoScriptData.metabox",{intl:{},isRtl:!1})}es.propTypes={target:a().string.isRequired,children:a().node.isRequired};const ts=()=>(0,l.useContext)(_.LocationContext),rs="yoast-seo/ai-generator",os="yoast-seo/editor",is="google",ns="social",as="twitter",ls="title",cs="description",ds="post",us="term",ps={post:"title",term:"term_title"},ms=(0,i.mapValues)(ps,e=>`%%${e}%%`),hs={idle:"idle",loading:"loading",success:"success",error:"error"},gs="success",ys="error",xs="abort";window.wp.sanitize;const{stripHTMLTags:ws}=o.strings,fs=["_formal","_informal","_ao90"],bs=e=>{for(const s of fs)if(e.endsWith(s))return e.slice(0,-s.length);return e};let vs,ks=!1;const _s="\\–\\-\\(\\)_\\[\\]’‘“”〝〞〟‟„\"'.?!:;,¿¡«»‹›—×+&۔؟،؛。。!‼?⁇⁉⁈‥…・ー、〃〄〆〇〈〉《》「」『』【】〒〓〔〕〖〗〘〙〚〛〜〝〞〟〠〶〼〽{}|~⦅⦆「」、[]・¥$%@&'()*/:;<>\\\<>";_s.split(""),new RegExp("^["+_s+"]+"),new RegExp("["+_s+"]+$");new RegExp("["+_s+"#$%&*+/=@^`{|}~ -¿–-⁊ -₠-⃀]","g");const js=e=>{const s={...e};return""!==e.value||["title","excerpt","excerpt_only"].includes(e.name)||(s.value="%%"+e.name+"%%"),s.badge=`<badge>${e.label}</badge>`,s},Ss=()=>{const e=(0,k.useSelect)(e=>e(os).getReplaceVars(),[]),s=(0,l.useMemo)(()=>e.map(js),[e]);return(0,l.useCallback)((e,{key:t="value",overrides:r={},applyPluggable:o=!0,editType:n=ls,contentType:a=ds}={})=>{for(const o of s)e=e.replace(new RegExp("%%"+(0,i.escapeRegExp)(o.name)+"%%","g"),(0,i.get)(r,o.name,o[t]));return a===us&&(e=e.replace(" Archives","")),o?((e,s=ls)=>{const t=function(e){const s=(0,i.get)(window,["YoastSEO","app","pluggable"],!1);if(!s||!(0,i.get)(window,["YoastSEO","app","pluggable","loaded"],!1))return function(e){const s=(0,i.get)(window,["YoastSEO","wp","replaceVarsPlugin","replaceVariables"],i.identity);return{url:e.url,title:ws(s(e.title)),description:ws(s(e.description)),filteredSEOTitle:e.filteredSEOTitle?ws(s(e.filteredSEOTitle)):""}}(e);const t=s._applyModifications.bind(s);return{url:e.url,title:ws(t("data_page_title",e.title)),description:ws(t("data_meta_desc",e.description)),filteredSEOTitle:e.filteredSEOTitle?ws(t("data_page_title",e.filteredSEOTitle)):""}}({title:"",description:"",[s]:Le.languageProcessing.stripSpaces(e)});return(0,i.get)(t,s,e)})(e,n):e},[s])},Cs={editType:ls,previewType:is,postType:"post",contentType:ds},Rs=(0,l.createContext)(Cs),Es=(Rs.Provider,()=>(0,l.useContext)(Rs)),Ls=e=>{const s=(0,l.useRef)(null);return(0,l.useCallback)(t=>{(0,i.attempt)(()=>s.current&&s.current.disconnect()),null!==t&&(s.current=new ResizeObserver(s=>{(0,i.forEach)(s,s=>e(s))}),s.current.observe(t))},[e])};t(2863);window.yoast.aiFrontend;const Ns=window.yoast.reduxJsToolkit,Ms="usageCount",Is="fetchUsageCount",Ts=`${Is}/success`,Ps={errorCode:null,errorIdentifier:null,errorMessage:null},As=(0,Ns.createSlice)({name:Ms,initialState:{status:"idle",count:0,limit:10,endpoint:"",error:Ps},reducers:{addUsageCount:(e,{payload:s=1})=>{e.count+=s},setUsageCount:(e,{payload:s})=>{e.count=s},setUsageCountEndpoint:(e,{payload:s})=>{e.endpoint=s},setUsageCountLimit:(e,{payload:s})=>{e.limit=s}},extraReducers:e=>{e.addCase(`${Is}/request`,e=>{e.status=me,e.error=Ps}),e.addCase(Ts,(e,{payload:s})=>{e.status="success",e.count=s.count,e.limit=s.limit,e.error=Ps}),e.addCase(`${Is}/${pe}`,(e,{payload:s})=>{e.status="error",e.error={errorCode:502,...s}})}}),Os=(As.getInitialState,{selectUsageCountStatus:e=>(0,i.get)(e,[Ms,"status"],As.getInitialState()),selectUsageCount:e=>(0,i.get)(e,[Ms,"count"],As.getInitialState().count),selectUsageCountLimit:e=>(0,i.get)(e,[Ms,"limit"],As.getInitialState().limit),selectUsageCountEndpoint:e=>(0,i.get)(e,[Ms,"endpoint"],As.getInitialState().endpoint),selectUsageCountError:e=>(0,i.get)(e,[Ms,"error"],As.getInitialState().error)});Os.selectUsageCountRemaining=(0,Ns.createSelector)([Os.selectUsageCount,Os.selectUsageCountLimit],(e,s)=>Math.max(s-e,0)),Os.isUsageCountLimitReached=(0,Ns.createSelector)([Os.selectUsageCount,Os.selectUsageCountLimit,Os.selectUsageCountError],(e,s,t)=>429===t.errorCode||e>=s),As.actions,As.reducer;const Bs=()=>{const e=(0,k.useSelect)(e=>e(os).selectLink("https://yoa.st/ai-common-errors"),[]),t=(0,k.useSelect)(e=>e(os).selectAdminLink("?page=wpseo_page_support"),[]);return(0,u.jsxs)(R.Alert,{variant:"error",children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:(0,s.__)("Something went wrong","wordpress-seo")}),(0,u.jsx)("p",{className:"yst-mt-2",children:O((0,s.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. */
66 -(0,s.__)("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,u.jsx)(re,{variant:"error",href:e}),a2:(0,u.jsx)(re,{variant:"error",href:t})})})]})},Fs=()=>{const e=(0,k.useSelect)(e=>e(os).selectLink("https://yoa.st/ai-common-errors"),[]),t=(0,k.useSelect)(e=>e(os).selectAdminLink("?page=wpseo_page_support"),[]);return(0,u.jsxs)(R.Alert,{variant:"error",children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:(0,s.__)("Not enough content","wordpress-seo")}),(0,u.jsx)("p",{className:"yst-mt-2",children:O((0,s.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. */
67 -(0,s.__)("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,u.jsx)(re,{variant:"error",href:e}),a2:(0,u.jsx)(re,{variant:"error",href:t})})})]})},qs=()=>{const e=(0,k.useSelect)(e=>e(os).selectAdminLink("?page=wpseo_page_settings#/site-features#card-wpseo-keyword_analysis_active"),[]),t=(0,l.useCallback)(()=>{window.location.reload()},[]),{onClose:r}=(0,R.useModalContext)();return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(R.Alert,{variant:"error",children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:(0,s.__)("SEO analysis required","wordpress-seo")}),(0,u.jsx)("p",{className:"yst-mt-2",children:O((0,s.sprintf)(
68 -/**
69 - * translators:
70 - * %1$s expands to Yoast SEO.
71 - * %2$s and %3$s expand to an opening and closing anchor tag, respectively, that links to the settings page.
72 - * %4$s expands to Yoast AI.
73 - */
74 -/**
75 - * translators:
76 - * %1$s expands to Yoast SEO.
77 - * %2$s and %3$s expand to an opening and closing anchor tag, respectively, that links to the settings page.
78 - * %4$s expands to Yoast AI.
79 - */
80 -(0,s.__)("%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,u.jsx)(re,{variant:"error",href:e})})})]}),(0,u.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,u.jsx)(R.Button,{variant:"secondary",onClick:r,children:(0,s.__)("Close","wordpress-seo")}),(0,u.jsx)(R.Button,{className:"yst-revoke-button",variant:"primary",onClick:t,children:(0,s.__)("Refresh page","wordpress-seo")})]})]})},$s=()=>{const e=(0,k.useSelect)(e=>e(os).selectLink("https://yoa.st/ai-generator-rate-limit-help"),[]);return(0,u.jsxs)(R.Alert,{variant:"error",children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:(0,s.__)("You've reached the Yoast AI rate limit","wordpress-seo")}),(0,u.jsx)("p",{className:"yst-mt-2",children:O((0,s.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. */
81 -(0,s.__)("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,u.jsx)(re,{variant:"error",href:e})})})]})},Us=({invalidSubscriptions:e=[]})=>{const{newYoastWooLink:t,activateYoastWooLink:r,newPremiumLink:o,activatePremiumLink:i,bustSubscriptionCacheEndpoint:n}=(0,k.useSelect)(e=>{const s=e(os);return{newYoastWooLink:s.selectLink("https://yoa.st/ai-generator-new-yoast-woocommerce"),activateYoastWooLink:s.selectLink("https://yoa.st/ai-generator-activate-yoast-woocommerce"),newPremiumLink:s.selectLink("https://yoa.st/ai-generator-new-premium"),activatePremiumLink:s.selectLink("https://yoa.st/ai-generator-activate-premium"),bustSubscriptionCacheEndpoint:e(rs).selectBustSubscriptionCacheEndpoint()}},[]),{onClose:a}=(0,R.useModalContext)(),c=(0,l.useCallback)(async()=>{try{await C()({path:n,method:"POST",parse:!1})}catch(e){console.error(e)}window.location.reload()},[]);let d,p,m;return e.includes("Yoast WooCommerce SEO")?(d="Yoast WooCommerce SEO",p=r,m=t):e.includes("Yoast SEO Premium")&&(d="Yoast SEO Premium",p=i,m=o),(0,u.jsxs)(l.Fragment,{children:[(0,u.jsxs)(R.Alert,{variant:"error",children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:(0,s.__)("Subscription required","wordpress-seo")}),(0,u.jsx)("p",{className:"yst-mt-2",children:O((0,s.sprintf)(
82 -/**
83 - * translators:
84 - * %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO.
85 - * %2$s expands to MyYoast.
86 - * %3$s and %4$s expand to an opening and closing anchor tag, respectively, to activate your subscription.
87 - * %5$s and %6$s expand to an opening and closing anchor tag, respectively, to get a new subscription.
88 - **/
89 -/**
90 - * translators:
91 - * %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO.
92 - * %2$s expands to MyYoast.
93 - * %3$s and %4$s expand to an opening and closing anchor tag, respectively, to activate your subscription.
94 - * %5$s and %6$s expand to an opening and closing anchor tag, respectively, to get a new subscription.
95 - **/
96 -(0,s.__)("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"),d,"MyYoast","<Activate>","</Activate>","<New>","</New>"),{Activate:(0,u.jsx)(re,{variant:"error",href:p}),New:(0,u.jsx)(re,{variant:"error",href:m})})})]}),(0,u.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,u.jsx)(R.Button,{variant:"secondary",onClick:a,children:(0,s.__)("Close","wordpress-seo")}),(0,u.jsx)(R.Button,{variant:"primary",onClick:c,children:(0,s.__)("Refresh page","wordpress-seo")})]})]})};Us.propTypes={invalidSubscriptions:a().arrayOf(a().string)};const Ws=()=>{const e=(0,k.useSelect)(e=>e(os).selectLink("https://yoa.st/ai-common-errors"),[]),t=(0,k.useSelect)(e=>e(os).selectAdminLink("?page=wpseo_page_support"),[]);return(0,u.jsxs)(R.Alert,{variant:"error",children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:(0,s.__)("Connection timeout","wordpress-seo")}),(0,u.jsx)("p",{className:"yst-mt-2",children:O((0,s.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. */
97 -(0,s.__)("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,u.jsx)(re,{variant:"error",href:e}),a2:(0,u.jsx)(re,{variant:"error",href:t})})})]})},Hs=()=>{const e=(0,k.useSelect)(e=>e(os).selectAdminLink("?page=wpseo_page_support"),[]);return(0,u.jsxs)(R.Alert,{variant:"error",children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:(0,s.__)("Usage policy violation","wordpress-seo")}),(0,u.jsx)("p",{className:"yst-mt-2",children:O((0,s.sprintf)(
98 -/* translators: %1$s, %2$s, %3$s, %4$s are anchor tags.
99 - * %5$s expands to OpenAI.
100 - */
101 -/* translators: %1$s, %2$s, %3$s, %4$s are anchor tags.
102 - * %5$s expands to OpenAI.
103 - */
104 -(0,s.__)("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,u.jsx)(re,{variant:"error",href:"https://openai.com/policies/usage-policies"}),a2:(0,u.jsx)(re,{variant:"error",href:e})})})]})},zs=({errorMessage:e=""})=>{const t=(0,k.useSelect)(e=>e(os).selectAdminLink("?page=wpseo_page_support"),[]);return(0,u.jsxs)(R.Alert,{variant:"error",children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:(0,s.__)("Something went wrong","wordpress-seo")}),(0,u.jsx)("p",{className:"yst-mt-2",children:(0,s.sprintf)(/* translators: %s is the error response of the request. */ /* translators: %s is the error response of the request. */
105 -(0,s.__)("The request came back with the following error: '%s'.","wordpress-seo"),e)}),(0,u.jsx)("p",{className:"yst-mt-2",children:O((0,s.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. */
106 -(0,s.__)("Please try again later. If the issue persists, please %1$scontact our support team%2$s.","wordpress-seo"),"<a>","</a>"),{a:(0,u.jsx)(re,{variant:"error",href:t})})})]})};zs.propTypes={errorMessage:a().string};const Ds=()=>{const e=(0,k.useSelect)(e=>e(os).selectAdminLink("plugins.php"),[]);return(0,u.jsxs)(R.Alert,{variant:"error",children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:(0,s.__)("Something went wrong","wordpress-seo")}),(0,u.jsx)("p",{className:"yst-mt-2",children:O((0,s.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. */
107 -(0,s.__)("The version of %1$s is outdated. Please upgrade %1$s %2$shere%3$s!","wordpress-seo"),"Yoast SEO Premium","<a>","</a>"),{a:(0,u.jsx)(re,{variant:"error",href:e})})})]})},Ks=()=>{const e=(0,k.useSelect)(e=>e(os).selectLink("https://yoa.st/ai-common-errors"),[]),t=(0,k.useSelect)(e=>e(os).selectAdminLink("?page=wpseo_page_support"),[]);return(0,u.jsxs)(R.Alert,{variant:"error",children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:(0,s.__)("Yoast AI cannot reach your site","wordpress-seo")}),(0,u.jsx)("p",{className:"yst-mt-2",children:O((0,s.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. */
108 -(0,s.__)("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,u.jsx)(re,{variant:"error",href:e}),a2:(0,u.jsx)(re,{variant:"error",href:t})})})]})},Gs=({errorCode:e,errorIdentifier:s="",errorMessage:t=""})=>{switch(e){case 400:switch(s){case"SITE_UNREACHABLE":return(0,u.jsx)(Ks,{});case"WP_HTTP_REQUEST_ERROR":return(0,u.jsx)(zs,{errorMessage:t});default:return(0,u.jsx)(Bs,{})}case 429:return(0,u.jsx)($s,{});default:return(0,u.jsx)(Bs,{})}};Gs.propTypes={errorCode:a().number.isRequired,errorIdentifier:a().string,errorMessage:a().string};const Ys=({currentSubscriptions:e,isSeoAnalysisActive:s=!0})=>{const{isPremium:t,usageCountStatus:r,usageCountError:o,isWooProductEntity:i,isWooSeoActive:n}=(0,k.useSelect)(e=>{const s=e(os);return{isPremium:s.getIsPremium(),usageCountStatus:e(rs).selectUsageCountStatus(),usageCountError:e(rs).selectUsageCountError(),isWooProductEntity:s.getIsWooProductEntity(),isWooSeoActive:s.getIsWooSeoActive()}},[]),a=(0,l.useMemo)(()=>!e.wooCommerceSubscription&&i,[e.wooCommerceSubscription]),c=(0,l.useMemo)(()=>{const s=[];return!t&&!i||e.premiumSubscription||s.push("Yoast SEO Premium"),a&&n&&s.push("Yoast WooCommerce SEO"),s},[t,e.premiumSubscription,a,n,i]);return c.length>0?(0,u.jsx)(Us,{invalidSubscriptions:c}):s?r===hs.error?(0,u.jsx)(Gs,{...o}):void 0:(0,u.jsx)(qs,{})};Ys.propTypes={currentSubscriptions:a().object.isRequired,isSeoAnalysisActive:a().bool};const Vs=({onStartGenerating:e})=>(0,u.jsx)(be,{storeName:rs,linkStoreName:os,onConsentGranted:e});Vs.propTypes={onStartGenerating:a().func.isRequired};var Zs=t(7219),Qs=t.n(Zs);const Js=e=>{var s,t;const r=null===(s=(0,k.useDispatch)("core/edit-post"))||void 0===s?void 0:s.openGeneralSidebar,o=null===(t=(0,k.useDispatch)("core/editor"))||void 0===t?void 0:t.closePublishSidebar,{openEditorModal:i}=(0,k.useDispatch)("yoast-seo/editor");return(0,l.useCallback)(()=>{o(),r("yoast-seo/seo-sidebar"),e&&i("yoast-search-appearance-modal")},[o,r,i])},Xs=/(?<start><\/badge>|^(?!<badge>))(?<wrap>[\s\S]+?)(?<end><badge>|$)/g,et=({total:e,current:t,onNavigate:r,disabled:o=!1,...i})=>(0,u.jsxs)("div",{className:"yst-flex yst-justify-between yst-gap-x-2 yst-items-start",children:[(0,u.jsx)("p",{className:"yst-text-slate-500 yst-text-xxs yst-mt-1",children:(0,s.__)("Text generated by AI may be offensive or inaccurate.","wordpress-seo")}),e>1&&(0,u.jsx)(R.Pagination,{className:"yst-shrink-0",current:t,total:e,onNavigate:r,disabled:o,variant:"text"
193 +`);function xt({target:e,children:s}){return(0,u.jsx)(Qs,{target:e,children:s})}function wt(){return(0,i.get)(window,"wpseoScriptData.metabox",{intl:{},isRtl:!1})}xt.propTypes={target:a().string.isRequired,children:a().node.isRequired};const ft=()=>(0,l.useContext)(R.LocationContext);window.wp.sanitize;const{stripHTMLTags:bt}=r.strings,vt=["_formal","_informal","_ao90"],kt=e=>{for(const s of vt)if(e.endsWith(s))return e.slice(0,-s.length);return e};let jt,_t=!1;const St="\\–\\-\\(\\)_\\[\\]’‘“”〝〞〟‟„\"'.?!:;,¿¡«»‹›—×+&۔؟،؛。。!‼?⁇⁉⁈‥…・ー、〃〄〆〇〈〉《》「」『』【】〒〓〔〕〖〗〘〙〚〛〜〝〞〟〠〶〼〽{}|~⦅⦆「」、[]・¥$%@&'()*/:;<>\\\<>";St.split(""),new RegExp("^["+St+"]+"),new RegExp("["+St+"]+$");const Ct=new RegExp("["+St+"#$%&*+/=@^`{|}~ -¿–-⁊ -₠-⃀]","g"),Rt=e=>{const s={...e};return""!==e.value||["title","excerpt","excerpt_only"].includes(e.name)||(s.value="%%"+e.name+"%%"),s.badge=`<badge>${e.label}</badge>`,s},Et=()=>{const e=(0,C.useSelect)(e=>e(Ee).getReplaceVars(),[]),s=(0,l.useMemo)(()=>e.map(Rt),[e]);return(0,l.useCallback)((e,{key:t="value",overrides:o={},applyPluggable:r=!0,editType:n=Me,contentType:a=Ae}={})=>{for(const r of s)e=e.replace(new RegExp("%%"+(0,i.escapeRegExp)(r.name)+"%%","g"),(0,i.get)(o,r.name,r[t]));return a===Pe&&(e=e.replace(" Archives","")),r?((e,s=Me)=>{const t=function(e){const s=(0,i.get)(window,["YoastSEO","app","pluggable"],!1);if(!s||!(0,i.get)(window,["YoastSEO","app","pluggable","loaded"],!1))return function(e){const s=(0,i.get)(window,["YoastSEO","wp","replaceVarsPlugin","replaceVariables"],i.identity);return{url:e.url,title:bt(s(e.title)),description:bt(s(e.description)),filteredSEOTitle:e.filteredSEOTitle?bt(s(e.filteredSEOTitle)):""}}(e);const t=s._applyModifications.bind(s);return{url:e.url,title:bt(t("data_page_title",e.title)),description:bt(t("data_meta_desc",e.description)),filteredSEOTitle:e.filteredSEOTitle?bt(t("data_page_title",e.filteredSEOTitle)):""}}({title:"",description:"",[s]:Ks.languageProcessing.stripSpaces(e)});return(0,i.get)(t,s,e)})(e,n):e},[s])},Lt={editType:Me,previewType:Le,postType:"post",contentType:Ae},Nt=(0,l.createContext)(Lt),It=(Nt.Provider,()=>(0,l.useContext)(Nt)),Mt=e=>{const s=(0,l.useRef)(null);return(0,l.useCallback)(t=>{(0,i.attempt)(()=>s.current&&s.current.disconnect()),null!==t&&(s.current=new ResizeObserver(s=>{(0,i.forEach)(s,s=>e(s))}),s.current.observe(t))},[e])},Tt=({errorCode:e,errorIdentifier:s="",isOpen:t=!0,invalidSubscriptions:o=[],showActions:r=!1,onRetry:n=i.noop,errorMessage:a="",onClose:l=i.noop})=>{if("SEO_ANALYSIS_INACTIVE"===s)return(0,u.jsx)(Ls,{isOpen:t,onClose:l});if(402===e||429===e&&"USAGE_LIMIT_REACHED"===s)return(0,u.jsx)(Es,{isOpen:t,invalidSubscriptions:o,onClose:l});switch(e){case 400:switch(s){case"AI_CONTENT_FILTER":return(0,u.jsx)(Ss,{isOpen:t,onClose:l});case"NOT_ENOUGH_CONTENT":return(0,u.jsx)(_s,{isOpen:t,onClose:l});case"SITE_UNREACHABLE":return(0,u.jsx)(Ps,{isOpen:t,onClose:l});case"WP_HTTP_REQUEST_ERROR":return(0,u.jsx)(js,{isOpen:t,errorMessage:a,showActions:r,onRetry:n,onClose:l});default:return(0,u.jsx)(vs,{isOpen:t,showActions:r,onRetry:n,onClose:l})}case 408:return(0,u.jsx)(ks,{isOpen:t,showActions:r,onRetry:n,onClose:l});case 429:return(0,u.jsx)(Cs,{isOpen:t,onClose:l});case 410:return(0,u.jsx)(Rs,{isOpen:t,onClose:l});default:return(0,u.jsx)(vs,{isOpen:t,showActions:r,onRetry:n,onClose:l})}};Tt.propTypes={errorCode:a().number.isRequired,errorIdentifier:a().string,isOpen:a().bool,invalidSubscriptions:a().arrayOf(a().string),showActions:a().bool,onRetry:a().func,errorMessage:a().string,onClose:a().func};var At=t(2863),Pt=t.n(At);const Ot=window.yoast.aiFrontend,Bt=window.yoast.reduxJsToolkit,Ft="usageCount",$t="fetchUsageCount",qt=`${$t}/success`,Ut=`${$t}/${be}`,Wt={errorCode:null,errorIdentifier:null,errorMessage:null},Ht=(0,Bt.createSlice)({name:Ft,initialState:{status:"idle",count:0,limit:10,endpoint:"",error:Wt},reducers:{addUsageCount:(e,{payload:s=1})=>{e.count+=s},setUsageCount:(e,{payload:s})=>{e.count=s},setUsageCountEndpoint:(e,{payload:s})=>{e.endpoint=s},setUsageCountLimit:(e,{payload:s})=>{e.limit=s}},extraReducers:e=>{e.addCase(`${$t}/request`,e=>{e.status=ve,e.error=Wt}),e.addCase(qt,(e,{payload:s})=>{e.status="success",e.count=s.count,e.limit=s.limit,e.error=Wt}),e.addCase(`${$t}/${be}`,(e,{payload:s})=>{e.status=ke,e.error={errorCode:502,...s}})}}),zt=(Ht.getInitialState,{selectUsageCountStatus:e=>(0,i.get)(e,[Ft,"status"],Ht.getInitialState()),selectUsageCount:e=>(0,i.get)(e,[Ft,"count"],Ht.getInitialState().count),selectUsageCountLimit:e=>(0,i.get)(e,[Ft,"limit"],Ht.getInitialState().limit),selectUsageCountEndpoint:e=>(0,i.get)(e,[Ft,"endpoint"],Ht.getInitialState().endpoint),selectUsageCountError:e=>(0,i.get)(e,[Ft,"error"],Ht.getInitialState().error)});zt.selectUsageCountRemaining=(0,Bt.createSelector)([zt.selectUsageCount,zt.selectUsageCountLimit],(e,s)=>Math.max(s-e,0)),zt.isUsageCountLimitReached=(0,Bt.createSelector)([zt.selectUsageCount,zt.selectUsageCountLimit,zt.selectUsageCountError],(e,s,t)=>429===t.errorCode||e>=s),Ht.actions,Ht.reducer;const Dt=({onStartGenerating:e})=>(0,u.jsx)(Fs,{storeName:Re,linkStoreName:Ee,onConsentGranted:e});Dt.propTypes={onStartGenerating:a().func.isRequired};var Kt=t(7219),Gt=t.n(Kt);const Yt=e=>{var s,t;const o=null===(s=(0,C.useDispatch)("core/edit-post"))||void 0===s?void 0:s.openGeneralSidebar,r=null===(t=(0,C.useDispatch)("core/editor"))||void 0===t?void 0:t.closePublishSidebar,{openEditorModal:i}=(0,C.useDispatch)("yoast-seo/editor");return(0,l.useCallback)(()=>{r(),o("yoast-seo/seo-sidebar"),e&&i("yoast-search-appearance-modal")},[r,o,i])},Vt=/(?<start><\/badge>|^(?!<badge>))(?<wrap>[\s\S]+?)(?<end><badge>|$)/g,Zt=({total:e,current:t,onNavigate:o,disabled:r=!1,...i})=>(0,u.jsxs)("div",{className:"yst-flex yst-justify-between yst-gap-x-2 yst-items-start",children:[(0,u.jsx)("p",{className:"yst-text-slate-500 yst-text-xxs yst-mt-1",children:(0,s.__)("Text generated by AI may be offensive or inaccurate.","wordpress-seo")}),e>1&&(0,u.jsx)(I.Pagination,{className:"yst-shrink-0",current:t,total:e,onNavigate:o,disabled:r,variant:"text"
109 194 /* translators: Hidden accessibility text. */,screenReaderTextPrevious:(0,s.__)("Previous","wordpress-seo")
110 -/* translators: Hidden accessibility text. */,screenReaderTextNext:(0,s.__)("Next","wordpress-seo"),...i})]}),st=({height:e})=>{const[t,r]=(0,l.useState)(""),{onClose:o}=(0,R.useModalContext)(),{editType:n,previewType:a,contentType:c}=Es(),d=(()=>{const{editType:e,previewType:t}=Es();let r="SEO";switch(t){case ns:r="social";break;case as:r="X"}switch(e){case ls:return(0,s.sprintf)(/* translators: %s is the type of title. */ /* translators: %s is the type of title. */
111 -(0,s.__)("Generated %s titles","wordpress-seo"),r);case cs:return t===is&&(r="meta"),(0,s.sprintf)(/* translators: %s is the type of description. */ /* translators: %s is the type of description. */
112 -(0,s.__)("Generated %s descriptions","wordpress-seo"),r)}})(),p=(()=>{const{editType:e,previewType:t}=Es();let r="SEO";switch(t){case ns:r="social";break;case as:r="X"}switch(e){case ls:return(0,s.sprintf)(/* translators: %s is the type of title. */ /* translators: %s is the type of title. */
113 -(0,s.__)("Apply %s title","wordpress-seo"),r);case cs:return t===is&&(r="meta"),(0,s.sprintf)(/* translators: %s is the type of description. */ /* translators: %s is the type of description. */
114 -(0,s.__)("Apply %s description","wordpress-seo"),r)}})(),m=ts(),{suggestions:h,fetchSuggestions:g,setSelectedSuggestion:y}=jr(),x=br(),{addAppliedSuggestion:w,addUsageCount:f}=(0,k.useDispatch)(rs),{isUsageCountLimitReached:b,isWooProductEntity:v,hasValidPremiumSubscription:_,hasValidWooSubscription:j}=(0,k.useSelect)(e=>{const s=e(rs),t=e(os);return{isUsageCountLimitReached:s.isUsageCountLimitReached(),isPremium:t.getIsPremium(),isWooProductEntity:t.getIsWooProductEntity(),isWooSeoActive:t.getIsWooSeoActive(),hasValidPremiumSubscription:s.selectPremiumSubscription(),hasValidWooSubscription:s.selectWooCommerceSubscription()}},[]),S=(0,l.useMemo)(()=>h.status===hs.loading||!(j||!b||!v)||!(_||!b),[_,b,h.status,v,j]),C=(0,R.usePrevious)(e),E=h.status===hs.success?e:C,{bottom:L}={bottom:`calc( (${E+"px"} - 100vh) / 2 + 32px )`},[N,M]=(0,l.useState)(!1),I=(0,l.useCallback)(e=>{M(e.target.offsetHeight!==e.target.scrollHeight)},[M]),T=Ls(I),P=Cr(),A=(()=>{const e=(()=>{const{previewType:e}=Es();return(0,l.useMemo)(()=>{switch(e){case is:return()=>(0,k.select)(os).getSnippetEditorData().description;case ns:return(0,k.select)(os).getFacebookDescriptionOrFallback;case as:return(0,k.select)(os).getTwitterDescriptionOrFallback;default:return(0,i.constant)("")}},[e])})();return(0,l.useMemo)(e,[e])})(),B=Ss(),F=(0,l.useMemo)(()=>n===ls?{[ps[c]]:h.selected}:{},[n,c,h.selected]),q=(0,l.useMemo)(()=>B(P,{overrides:F,contentType:c}),[B,P,n,c,h.selected]),$=(0,l.useMemo)(()=>B(P,{overrides:{...F,sep:"",sitename:""},contentType:c}),[B,P,n,c,h.selected]),U=(0,l.useMemo)(()=>n===cs?h.selected:B(A,{editType:cs}),[B,A,n,h.selected]),W=(0,l.useCallback)(e=>B(P,{overrides:{[ps[c]]:e},key:"badge",applyPluggable:!1,contentType:c}),[B,P,c]),{currentPage:H,setCurrentPage:z,isOnLastPage:D,totalPages:K,getItemsOnCurrentPage:G}=(({totalItems:e=0,perPage:s=5})=>{const[t,r]=(0,l.useState)(1),o=(0,l.useMemo)(()=>Math.ceil(e/s),[e,s]),n=(0,l.useMemo)(()=>t*s,[t,s]),a=(0,l.useMemo)(()=>n-s,[n,s]),c=(0,l.useMemo)(()=>1===t,[t]),d=(0,l.useMemo)(()=>t===o,[t,o]),u=(0,l.useCallback)(()=>{t>1&&r(t-1)},[t,r]),p=(0,l.useCallback)(()=>{t<o&&r(t+1)},[t,r,o]),m=(0,l.useCallback)(e=>(0,i.slice)(e,a,n),[a,n]);return{currentPage:t,setCurrentPage:r,totalPages:o,isOnFirstPage:c,isOnLastPage:d,previousPage:u,nextPage:p,firstOnPage:a,lastOnPage:n,getItemsOnCurrentPage:m}})({totalItems:h.status===hs.loading||h.status===hs.error?h.entities.length+5:h.entities.length,perPage:5}),Y=(0,l.useMemo)(()=>(0,i.map)(G(h.entities),e=>{let s=e;return n===ls&&(s=W(e),s=s.replace(Xs,(e,s,t,r,o,i,{start:n,wrap:a,end:l})=>{const c=a.trim();return 0===c.length?`${n}${a}${l}`:`${n}<span>${c}</span>${l}`}),s=O(s,{badge:(0,u.jsx)(R.Badge,{className:"yst-me-2 last:yst-me-0",variant:"plain",children:" "}),span:(0,u.jsx)("span",{className:"yst-flex yst-items-center yst-me-2 last:yst-me-0"})})),{value:e,label:s}}),[h.entities,G,n,W]),V=(0,l.useMemo)(()=>h.status!==hs.error||h.status===hs.error&&!D,[h.status,D]),Z=(0,l.useMemo)(()=>h.status===hs.loading&&D,[h.status,D]),Q=(0,l.useMemo)(()=>h.status===hs.error&&D,[h.status,D]),J=(0,l.useCallback)(()=>{S||(z(h.status===hs.error?K:K+1),g().then(e=>{e===gs&&f()}))},[g,h.status,K,z,y,b]),X=(0,l.useCallback)(()=>r(""),[r]),ee=vr(),se=Js(!0),te=(0,l.useCallback)(()=>{const e=n===ls?P.replace(new RegExp(ms[c]+"( Archives)?"),h.selected):h.selected;ee(e),w({editType:n,previewType:a,suggestion:h.selected}),o(),"pre-publish"===m&&se()},[ee,n,a,h.selected,P,o,w,se,m]);return((e,s=[])=>{const t=(0,l.useRef)(!1);(0,l.useEffect)(()=>{t.current||(t.current=!0,e().finally(()=>{t.current=!1}))},[e,s])})(()=>""===t?g().then(e=>{r(e),e===gs&&f()}):Promise.resolve(),[t,f,g]),t===ys||h.status===hs.error&&402===h.error.code?(0,u.jsx)("div",{className:"yst-flex yst-flex-col yst-space-y-6 yst-mt-6",children:(0,u.jsx)(or,{errorCode:h.error.code,errorIdentifier:h.error.errorIdentifier,invalidSubscriptions:h.error.missingLicenses,showActions:!0,onRetry:X,errorMessage:h.error.message})}):(0,u.jsxs)(l.Fragment,{children:[(0,u.jsxs)(R.Modal.Container.Content,{ref:T,className:"yst-flex yst-flex-col yst-py-6 yst-space-y-2",children:[(0,u.jsx)(x,{title:q,description:U,status:h.status,titleForLength:$,showPreviewSkeleton:""===t,showLengthProgress:!Z}),V&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{className:"yst-flex yst-space-y-4",children:[(0,u.jsx)(R.Label,{as:"span",className:"yst-flex-grow yst-cursor-default yst-mt-auto",children:d}),(0,u.jsx)(R.Button,{variant:"ai-secondary",size:"small",onClick:h.status===hs.loading?i.noop:J,isLoading:h.status===hs.loading,disabled:S,children:(0,s.__)("Generate 5 more","wordpress-seo")})]}),Z?(0,u.jsx)(cr,{idSuffix:m,suggestionClassNames:n===ls?[["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,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ar,{idSuffix:m,suggestions:Y,selected:h.selected,onChange:y}),(0,u.jsx)(et,{current:H,total:K,onNavigate:z,disabled:h.status===hs.loading||Q})]})]}),h.status===hs.error&&D&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"yst-mt-8"}),(0,u.jsx)(or,{errorCode:h.error.code,errorIdentifier:h.error.errorIdentifier,invalidSubscriptions:h.error.missingLicenses,errorMessage:h.error.message}),(0,u.jsx)(et,{current:H,total:K,onNavigate:z,disabled:h.status===hs.loading})]})]}),(0,u.jsxs)(R.Modal.Container.Footer,{children:[N&&(0,u.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,u.jsx)("hr",{className:"yst-mb-6 yst--mx-6"}),(0,u.jsxs)("div",{className:"sm:yst-flex sm:yst-justify-end sm:yst-space-x-2 sm:rtl:yst-space-x-reverse",children:[(0,u.jsx)("div",{className:"yst-hidden sm:yst-inline",children:(0,u.jsx)(R.Button,{variant:"secondary",onClick:o,children:(0,s.__)("Close","wordpress-seo")})}),(0,u.jsx)("div",{className:"yst-block sm:yst-inline",children:(0,u.jsxs)(R.Button,{className:"yst-w-full sm:yst-w-auto",variant:"primary",onClick:te,disabled:""===h.selected||h.status===hs.loading||Q,children:[(0,u.jsx)(Qs(),{className:"yst--ms-1 yst-me-1 yst-h-4 yst-w-4 yst-text-white"}),p]})}),(0,u.jsx)("div",{className:"yst-mt-3 sm:yst-hidden",children:(0,u.jsx)(R.Button,{variant:"secondary",onClick:o,className:"yst-w-full sm:yst-w-auto",children:(0,s.__)("Close","wordpress-seo")})})]})]}),(0,u.jsxs)(R.Notifications,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all",style:{bottom:L},position:"bottom-left",children:[h.status!==hs.loading&&(0,u.jsx)(fr,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all"}),(h.status===hs.success||h.status===hs.loading)&&(0,u.jsx)(ur,{})]})]})};st.propTypes={height:a().number.isRequired};a().func.isRequired;const tt=window.yoast.searchMetadataPreviews,rt=({title:e,description:t,status:r,titleForLength:o,showPreviewSkeleton:i,showLengthProgress:n})=>{const a=(0,k.useSelect)(e=>e(os).getSnippetEditorMode(),[]),[c,d]=(0,l.useState)(a),{editType:p}=Es(),m=ts(),h=Sr({editType:p,title:o,description:t});return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(tt.ModeSwitcher,{onChange:d,active:c,id:`yst-ai-google-preview-mode-switcher-${m}`,disabled:r===hs.loading}),i?(0,u.jsx)(nt,{}):(0,u.jsx)(it,{mode:c,title:e,description:t}),(0,u.jsxs)("div",{className:"yst-pt-4",children:[(0,u.jsx)(R.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:p===ls?(0,s.__)("SEO title width","wordpress-seo"):(0,s.__)("Meta description length","wordpress-seo")}),(0,u.jsx)(at,{className:"yst-mt-2",progress:n?h.actual:0,min:0,max:h.max,score:h.score})]})]})};rt.propTypes={title:a().string.isRequired,description:a().string.isRequired,status:a().oneOf(Object.keys(hs)).isRequired,titleForLength:a().string.isRequired,showPreviewSkeleton:a().bool.isRequired,showLengthProgress:a().bool.isRequired};const ot=/mobi/i,it=({mode:e,title:s,description:t})=>{var r,o;const n=(0,k.useSelect)(e=>e(os).getBaseUrlFromSettings(),[]),a=(0,k.useSelect)(e=>e(os).getSnippetEditorData().slug||"",[]),c=(0,k.useSelect)(e=>e(os).getDateFromSettings(),[]),d=(0,k.useSelect)(e=>e(os).getFocusKeyphrase(),[]),p=(0,k.useSelect)(e=>e(os).getSnippetEditorPreviewImageUrl(),[]),m=(0,k.useSelect)(e=>e(os).getSiteIconUrlFromSettings(),[]),h=(0,k.useSelect)(e=>e(os).getShoppingData(),[]),g=(0,k.useSelect)(e=>e(os).getSnippetEditorWordsToHighlight(),[]),y=(0,k.useSelect)(e=>e(os).getSiteName(),[]),x=(0,k.useSelect)(e=>e(os).getContentLocale(),[]),w=(0,l.useMemo)(()=>n+a,[n,a]),f=(0,l.useMemo)(()=>{var e,s;return ot.test(null===(e=window)||void 0===e||null===(s=e.navigator)||void 0===s?void 0:s.userAgent)},[null===(r=window)||void 0===r||null===(o=r.navigator)||void 0===o?void 0:o.userAgent]);return(0,u.jsx)("div",{className:`yst-ai-generator-preview-section ${e}${f?" yst-user-agent__mobile":""}`,children:(0,u.jsx)(tt.SnippetPreview,{title:s,description:t,mode:e,url:w,keyword:d,date:c,faviconSrc:m,mobileImageSrc:p,wordsToHighlight:g,siteName:y,locale:x,shoppingData:h,onMouseUp:i.noop})})};it.propTypes={mode:a().oneOf(Object.keys({mobile:"mobile",desktop:"desktop"})).isRequired,title:a().string.isRequired,description:a().string.isRequired};const nt=()=>(0,u.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,u.jsxs)("div",{className:"yst-flex yst-gap-x-3",children:[(0,u.jsx)(R.SkeletonLoader,{className:"yst-flex-shrink-0 yst-h-7 yst-w-7 yst-rounded-full"}),(0,u.jsxs)("div",{className:"yst-flex yst-flex-col yst-w-full yst-gap-y-1",children:[(0,u.jsx)(R.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,u.jsx)(R.SkeletonLoader,{className:"yst-h-2.5 yst-w-10/12"})]})]}),(0,u.jsx)(R.SkeletonLoader,{className:"yst-h-4 yst-w-full yst-mt-6 yst-mb-4"}),(0,u.jsx)(R.SkeletonLoader,{className:"yst-h-3 yst-w-full"}),(0,u.jsx)(R.SkeletonLoader,{className:"yst-h-3 yst-w-10/12 yst-mt-2.5"})]}),at=({className:e="",progress:s,max:t,score:r})=>{const o=(0,l.useMemo)(()=>(e=>e>=7?"yst-score-good":e>=5?"yst-score-ok":"yst-score-bad")(r),[r]);return(0,u.jsx)(R.ProgressBar,{className:ae()("yst-length-progress-bar",o,e),progress:s,min:0,max:t})};at.propTypes={className:a().string,progress:a().number.isRequired,max:a().number.isRequired,score:a().number.isRequired};const lt=({title:e,description:t,showPreviewSkeleton:r})=>(0,u.jsxs)("div",{children:[(0,u.jsx)("div",{className:"yst-flex yst-mb-6",children:(0,u.jsx)(R.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:(0,s.__)("Social preview","wordpress-seo")})}),r?(0,u.jsx)(tr,{}):(0,u.jsx)(sr,{title:e,description:t})]});lt.propTypes={title:a().string.isRequired,description:a().string.isRequired,showPreviewSkeleton:a().bool.isRequired};const ct=d().p`
195 +/* translators: Hidden accessibility text. */,screenReaderTextNext:(0,s.__)("Next","wordpress-seo"),...i})]}),Qt=({height:e,onFatalError:t})=>{const[o,r]=(0,l.useState)(""),{onClose:n}=(0,I.useModalContext)(),{editType:a,previewType:c,contentType:d}=It(),p=(()=>{const{editType:e,previewType:t}=It();let o="SEO";switch(t){case Ne:o="social";break;case Ie:o="X"}switch(e){case Me:return(0,s.sprintf)(/* translators: %s is the type of title. */ /* translators: %s is the type of title. */
196 +(0,s.__)("Generated %s titles","wordpress-seo"),o);case Te:return t===Le&&(o="meta"),(0,s.sprintf)(/* translators: %s is the type of description. */ /* translators: %s is the type of description. */
197 +(0,s.__)("Generated %s descriptions","wordpress-seo"),o)}})(),h=(()=>{const{editType:e,previewType:t}=It();let o="SEO";switch(t){case Ne:o="social";break;case Ie:o="X"}switch(e){case Me:return(0,s.sprintf)(/* translators: %s is the type of title. */ /* translators: %s is the type of title. */
198 +(0,s.__)("Apply %s title","wordpress-seo"),o);case Te:return t===Le&&(o="meta"),(0,s.sprintf)(/* translators: %s is the type of description. */ /* translators: %s is the type of description. */
199 +(0,s.__)("Apply %s description","wordpress-seo"),o)}})(),m=ft(),{suggestions:g,fetchSuggestions:y,setSelectedSuggestion:x}=Cr(),w=kr(),{addAppliedSuggestion:f,addUsageCount:b}=(0,C.useDispatch)(Re),{isUsageCountLimitReached:v,isWooProductEntity:k,hasValidPremiumSubscription:j,hasValidWooSubscription:_}=(0,C.useSelect)(e=>{const s=e(Re),t=e(Ee);return{isUsageCountLimitReached:s.isUsageCountLimitReached(),isPremium:t.getIsPremium(),isWooProductEntity:t.getIsWooProductEntity(),isWooSeoActive:t.getIsWooSeoActive(),hasValidPremiumSubscription:s.selectPremiumSubscription(),hasValidWooSubscription:s.selectWooCommerceSubscription()}},[]),S=(0,l.useMemo)(()=>g.status===Fe.loading||!(_||!v||!k)||!(j||!v),[j,v,g.status,k,_]),R=(0,I.usePrevious)(e),E=g.status===Fe.success?e:R,{bottom:L}={bottom:`calc( (${E+"px"} - 100vh) / 2 + 32px )`},[N,M]=(0,l.useState)(!1),T=(0,l.useCallback)(e=>{M(e.target.offsetHeight!==e.target.scrollHeight)},[M]),A=Mt(T),P=Er(),O=(()=>{const e=(()=>{const{previewType:e}=It();return(0,l.useMemo)(()=>{switch(e){case Le:return()=>(0,C.select)(Ee).getSnippetEditorData().description;case Ne:return(0,C.select)(Ee).getFacebookDescriptionOrFallback;case Ie:return(0,C.select)(Ee).getTwitterDescriptionOrFallback;default:return(0,i.constant)("")}},[e])})();return(0,l.useMemo)(e,[e])})(),B=Et(),F=(0,l.useMemo)(()=>a===Me?{[Oe[d]]:g.selected}:{},[a,d,g.selected]),$=(0,l.useMemo)(()=>B(P,{overrides:F,contentType:d}),[B,P,a,d,g.selected]),U=(0,l.useMemo)(()=>B(P,{overrides:{...F,sep:"",sitename:""},contentType:d}),[B,P,a,d,g.selected]),W=(0,l.useMemo)(()=>a===Te?g.selected:B(O,{editType:Te}),[B,O,a,g.selected]),H=(0,l.useCallback)(e=>B(P,{overrides:{[Oe[d]]:e},key:"badge",applyPluggable:!1,contentType:d}),[B,P,d]),{currentPage:z,setCurrentPage:D,isOnLastPage:K,totalPages:G,getItemsOnCurrentPage:Y}=(({totalItems:e=0,perPage:s=5})=>{const[t,o]=(0,l.useState)(1),r=(0,l.useMemo)(()=>Math.ceil(e/s),[e,s]),n=(0,l.useMemo)(()=>t*s,[t,s]),a=(0,l.useMemo)(()=>n-s,[n,s]),c=(0,l.useMemo)(()=>1===t,[t]),d=(0,l.useMemo)(()=>t===r,[t,r]),u=(0,l.useCallback)(()=>{t>1&&o(t-1)},[t,o]),p=(0,l.useCallback)(()=>{t<r&&o(t+1)},[t,o,r]),h=(0,l.useCallback)(e=>(0,i.slice)(e,a,n),[a,n]);return{currentPage:t,setCurrentPage:o,totalPages:r,isOnFirstPage:c,isOnLastPage:d,previousPage:u,nextPage:p,firstOnPage:a,lastOnPage:n,getItemsOnCurrentPage:h}})({totalItems:g.status===Fe.loading||g.status===Fe.error?g.entities.length+5:g.entities.length,perPage:5}),V=(0,l.useMemo)(()=>(0,i.map)(Y(g.entities),e=>{let s=e;return a===Me&&(s=H(e),s=s.replace(Vt,(e,s,t,o,r,i,{start:n,wrap:a,end:l})=>{const c=a.trim();return 0===c.length?`${n}${a}${l}`:`${n}<span>${c}</span>${l}`}),s=q(s,{badge:(0,u.jsx)(I.Badge,{className:"yst-me-2 last:yst-me-0",variant:"plain",children:" "}),span:(0,u.jsx)("span",{className:"yst-flex yst-items-center yst-me-2 last:yst-me-0"})})),{value:e,label:s}}),[g.entities,Y,a,H]),Z=(0,l.useMemo)(()=>g.status!==Fe.error||g.status===Fe.error&&!K,[g.status,K]),Q=(0,l.useMemo)(()=>g.status===Fe.loading&&K,[g.status,K]),X=(0,l.useMemo)(()=>g.status===Fe.error&&K,[g.status,K]),J=(0,l.useCallback)(()=>{S||(D(g.status===Fe.error?G:G+1),y().then(e=>{e===$e&&b()}))},[y,g.status,G,D,x,v]),ee=jr(),se=Yt(!0),te=(0,l.useCallback)(()=>{const e=a===Me?P.replace(new RegExp(Be[d]+"( Archives)?"),g.selected):g.selected;ee(e),f({editType:a,previewType:c,suggestion:g.selected}),n(),"pre-publish"===m&&se()},[ee,a,c,g.selected,P,n,f,se,m]);((e,s=[])=>{const t=(0,l.useRef)(!1);(0,l.useEffect)(()=>{t.current||(t.current=!0,e().finally(()=>{t.current=!1}))},[e,s])})(()=>""===o?y().then(e=>{r(e),e===$e&&b()}):Promise.resolve(),[o,b,y]);const oe=o===qe||g.status===Fe.error&&402===g.error.code;return(0,l.useEffect)(()=>{var e,s,o,r,i,n,a,l;oe&&t({errorCode:null!==(e=null===(s=g.error)||void 0===s?void 0:s.code)&&void 0!==e?e:0,errorIdentifier:null!==(o=null===(r=g.error)||void 0===r?void 0:r.errorIdentifier)&&void 0!==o?o:"",invalidSubscriptions:null!==(i=null===(n=g.error)||void 0===n?void 0:n.missingLicenses)&&void 0!==i?i:[],errorMessage:null!==(a=null===(l=g.error)||void 0===l?void 0:l.message)&&void 0!==a?a:""})},[oe,g.error,t]),oe?null:(0,u.jsxs)(l.Fragment,{children:[(0,u.jsxs)(I.Modal.Container.Content,{ref:A,className:"yst-flex yst-flex-col yst-py-6 yst-space-y-2",children:[(0,u.jsx)(w,{title:$,description:W,status:g.status,titleForLength:U,showPreviewSkeleton:""===o,showLengthProgress:!Q}),Z&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{className:"yst-flex yst-space-y-4",children:[(0,u.jsx)(I.Label,{as:"span",className:"yst-flex-grow yst-cursor-default yst-mt-auto",children:p}),(0,u.jsx)(I.Button,{variant:"ai-secondary",size:"small",onClick:g.status===Fe.loading?i.noop:J,isLoading:g.status===Fe.loading,disabled:S,children:(0,s.__)("Generate 5 more","wordpress-seo")})]}),Q?(0,u.jsx)(ur,{idSuffix:m,suggestionClassNames:a===Me?[["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,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(cr,{idSuffix:m,suggestions:V,selected:g.selected,onChange:x}),(0,u.jsx)(Zt,{current:z,total:G,onNavigate:D,disabled:g.status===Fe.loading||X})]})]}),X&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"yst-mt-8"}),(0,u.jsx)(nr,{errorCode:g.error.code,errorIdentifier:g.error.errorIdentifier,invalidSubscriptions:g.error.missingLicenses,errorMessage:g.error.message}),(0,u.jsx)(Zt,{current:z,total:G,onNavigate:D,disabled:g.status===Fe.loading})]})]}),(0,u.jsxs)(I.Modal.Container.Footer,{children:[N&&(0,u.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,u.jsx)("hr",{className:"yst-mb-6 yst--mx-6"}),(0,u.jsxs)("div",{className:"sm:yst-flex sm:yst-justify-end sm:yst-space-x-2 sm:rtl:yst-space-x-reverse",children:[(0,u.jsx)("div",{className:"yst-hidden sm:yst-inline",children:(0,u.jsx)(I.Button,{variant:"secondary",onClick:n,children:(0,s.__)("Close","wordpress-seo")})}),(0,u.jsx)("div",{className:"yst-block sm:yst-inline",children:(0,u.jsxs)(I.Button,{className:"yst-w-full sm:yst-w-auto",variant:"primary",onClick:te,disabled:""===g.selected||g.status===Fe.loading||X,children:[(0,u.jsx)(Gt(),{className:"yst--ms-1 yst-me-1 yst-h-4 yst-w-4 yst-text-white"}),h]})}),(0,u.jsx)("div",{className:"yst-mt-3 sm:yst-hidden",children:(0,u.jsx)(I.Button,{variant:"secondary",onClick:n,className:"yst-w-full sm:yst-w-auto",children:(0,s.__)("Close","wordpress-seo")})})]})]}),(0,u.jsxs)(I.Notifications,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all",style:{bottom:L},position:"bottom-left",children:[g.status!==Fe.loading&&(0,u.jsx)(vr,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all"}),(g.status===Fe.success||g.status===Fe.loading)&&(0,u.jsx)(hr,{})]})]})};Qt.propTypes={height:a().number.isRequired,onFatalError:a().func.isRequired};const Xt=({onActivateFreeSparks:e})=>{const{premiumUpsellLink:t,wooUpsellLink:o,isWooCommerceActive:r,isProductPost:i,learnMoreLink:n,imageLink:a,wistiaEmbedPermissionValue:c,wistiaEmbedPermissionStatus:d,isUsageCountLimitReached:p,activateFreeSparksEndpoint:h}=(0,C.useSelect)(e=>{const s=e(Re),t=e(Ee);return{premiumUpsellLink:t.selectLink("https://yoa.st/ai-generator-upsell"),wooUpsellLink:t.selectLink("https://yoa.st/ai-generator-upsell-woo-seo"),isWooCommerceActive:t.getIsWooCommerceActive(),isProductPost:t.getIsProduct(),learnMoreLink:t.selectLink("https://yoa.st/ai-generator-learn-more"),imageLink:t.selectImageLink("ai-generator-preview.jpg"),wistiaEmbedPermissionValue:t.selectWistiaEmbedPermissionValue(),wistiaEmbedPermissionStatus:t.selectWistiaEmbedPermissionStatus(),isUsageCountLimitReached:s.isUsageCountLimitReached(),activateFreeSparksEndpoint:s.selectFreeSparksActiveEndpoint()}},[]),{onClose:m,initialFocus:g}=(0,I.useModalContext)(),{title:y,upsellLabel:x,upsellLink:w,ctbId:f,newToText:b}=Lr({premium:t,woo:o}),v=(0,l.useMemo)(()=>r&&i,[r,i]),k=(0,l.useMemo)(()=>({src:a,width:"432",height:"244"}),[a]),{setWistiaEmbedPermission:j}=(0,C.useDispatch)(Ee),{activateFreeSparks:_}=(0,C.useDispatch)(Re),S=(0,l.useMemo)(()=>({value:c,status:d,set:j}),[c,d,j]),R=(0,l.useCallback)(()=>{_({endpoint:h}),e()},[_,h,m,e]),E={a:(0,u.jsx)(ce,{href:n,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,u.jsx)(K(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"})};return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center",children:[(0,u.jsxs)("div",{className:"yst-relative yst-w-full",children:[(0,u.jsx)(Ce,{videoId:"vmrahpfjxp",thumbnail:k,wistiaEmbedPermission:S}),(0,u.jsx)(I.Badge,{className:"yst-absolute yst--top-2 yst-end-4",variant:"info",children:"Beta"})]}),(0,u.jsx)("div",{className:"yst-mt-6 yst-text-xs yst-font-medium yst-flex yst-flex-col yst-items-center",children:(0,u.jsxs)("span",{className:"yst-introduction-modal-uppercase yst-flex yst-gap-2 yst-items-center",children:[(0,u.jsx)("span",{className:"yst-logo-icon"}),b]})})]}),(0,u.jsxs)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center",children:[(0,u.jsxs)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center",children:[(0,u.jsx)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium",children:y}),(0,u.jsx)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm",children:q(v?(0,s.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. */
200 +(0,s.__)("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,s.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. */
201 +(0,s.__)("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>"),E)})]}),p&&(0,u.jsx)(I.Alert,{className:"yst-my-4",children:(0,s.sprintf)(/* translators: %s is for Yoast SEO Premium. */ /* translators: %s is for Yoast SEO Premium. */
202 +(0,s.__)("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,u.jsxs)("div",{className:he()("yst-w-full yst-flex yst-flex-col",p?"yst-mt-0":"yst-mt-6"),children:[(0,u.jsxs)(I.Button,{as:"a",className:"yst-grow",size:"extra-large",variant:"upsell",href:w,target:"_blank",ref:g,"data-action":"load-nfd-ctb","data-ctb-id":f,children:[(0,u.jsx)(z(),{className:"yst--ms-1 yst-me-2 yst-h-5 yst-w-5"}),x,(0,u.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
203 +(0,s.__)("(Opens in a new browser tab)","wordpress-seo")})]}),!p&&(0,u.jsx)(I.Button,{variant:"ai-secondary",onClick:R,className:"yst-mt-2 yst-w-full yst-text-base yst-text-slate-800 yst-font-medium yst-h-11",children:(0,s.__)("Try for free","wordpress-seo")})]}),(0,u.jsx)(I.Button,{as:"a",className:"yst-mt-4",variant:"tertiary",onClick:m,children:(0,s.__)("Close","wordpress-seo")})]})]})},Jt=({isOpen:e,onClose:t,closeButtonScreenReaderText:o,panelRef:r,title:i,aiModalHelperLink:n,children:a})=>{const l=(0,I.useSvgAria)();return(0,u.jsx)(I.Modal,{className:"yst-ai-modal",isOpen:e,onClose:t,children:(0,u.jsx)(I.Modal.Panel,{ref:r,className:"yst-max-w-3xl yst-relative",closeButtonScreenReaderText:o,children:(0,u.jsxs)(I.Modal.Container,{children:[(0,u.jsxs)(I.Modal.Container.Header,{children:[(0,u.jsxs)("div",{className:"yst-flex yst-items-center",children:[(0,u.jsx)("span",{className:"yst-logo-icon yst-h-5 yst-w-5"}),(0,u.jsx)(I.Modal.Title,{className:"yst-ms-3 yst-me-1.5",as:"h1",size:"2",children:i}),(0,u.jsx)(I.Link,{id:"ai-modal-learn-more",href:n,variant:"primary",className:"yst-no-underline yst-me-2",target:"_blank",rel:"noopener"
204 +/* translators: Hidden accessibility text. */,"aria-label":(0,s.__)("Learn more about AI (Opens in a new browser tab)","wordpress-seo"),children:(0,u.jsx)(Pt(),{...l,className:"yst-w-4 yst-h-4 yst-text-slate-500 yst-shrink-0"})}),(0,u.jsx)(I.Badge,{variant:"info",children:(0,s.__)("Beta","wordpress-seo")})]}),(0,u.jsx)("hr",{className:"yst-mt-6 yst--mx-6"})]}),a]})})})},eo=({isOpen:e,onClose:s,closeButtonScreenReaderText:t,children:o})=>(0,u.jsx)(I.Modal,{className:"yst-introduction-modal",isOpen:e,onClose:s,children:(0,u.jsx)(I.Modal.Panel,{className:"yst-max-w-lg yst-p-0 yst-rounded-3xl",closeButtonScreenReaderText:t,children:o})}),so={inactive:"inactive",askConsent:"askConsent",upsell:"upsell",generate:"generate"};(({onUseAi:e})=>{const[t,o]=(0,l.useState)(so.inactive),{editType:r,previewType:i}=It(),n=ft(),a=(()=>{const{editType:e,previewType:t}=It();switch(t){case Ne:return e===Te?(0,s.__)("AI social description generator","wordpress-seo"):(0,s.__)("AI social title generator","wordpress-seo");case Ie:return e===Te?(0,s.__)("AI X description generator","wordpress-seo"):(0,s.__)("AI X title generator","wordpress-seo");default:return e===Te?(0,s.__)("AI description generator","wordpress-seo"):(0,s.__)("AI title generator","wordpress-seo")}})(),{hasConsent:c,promptContentInitialized:d,currentSubscriptions:p,usageCountStatus:h,usageCount:m,usageCountLimit:g,usageCountEndpoint:y,hasValidPremiumSubscription:x,hasValidWooSubscription:w,focusKeyphrase:f,isPremium:b,isSeoAnalysisActive:v,aiModalHelperLink:k,isWooProductEntity:j,isFreeSparksActive:_,isWooSeoActive:S}=(0,C.useSelect)(e=>{const s=e(Re),t=e(Ee);return{hasConsent:s.selectHasAiGeneratorConsent(),promptContentInitialized:s.selectPromptContentInitialized(),currentSubscriptions:s.selectProductSubscriptions(),usageCountStatus:s.selectUsageCountStatus(),usageCount:s.selectUsageCount(),usageCountLimit:s.selectUsageCountLimit(),usageCountEndpoint:s.selectUsageCountEndpoint(),hasValidPremiumSubscription:s.selectPremiumSubscription(),hasValidWooSubscription:s.selectWooCommerceSubscription(),focusKeyphrase:t.getFocusKeyphrase(),isPremium:t.getIsPremium(),isWooSeoActive:t.getIsWooSeoActive(),isSeoAnalysisActive:t.getPreference("isKeywordAnalysisActive",!0),aiModalHelperLink:t.selectLink("https://yoa.st/ai-generator-help-button-modal"),isWooProductEntity:t.getIsWooProductEntity(),isFreeSparksActive:e(Re).selectIsFreeSparksActive()}},[]),{fetchUsageCount:R}=(0,C.useDispatch)(Re),{closeEditorModal:E}=(0,C.useDispatch)(Ee),L=(0,s.__)("Close modal","wordpress-seo"),[N,M]=(0,l.useState)(!1),[T,A]=(0,l.useState)(0),P=(0,l.useCallback)(e=>A(e.borderBoxSize[0].blockSize),[A]),O=Mt(P),[B,F]=(0,l.useState)(null),$=(0,l.useCallback)(({currentSubscriptions:e,isSeoAnalysisActive:s})=>{const t=(e=>{const s=(0,C.select)(Ee),t=[];return((e,s)=>(e.getIsPremium()||e.getIsWooProductEntity())&&!s.premiumSubscription)(s,e)&&t.push("Yoast SEO Premium"),((e,s)=>e.getIsWooProductEntity()&&e.getIsWooSeoActive()&&!s.wooCommerceSubscription)(s,e)&&t.push("Yoast WooCommerce SEO"),t})(e);return t.length>0?{errorCode:402,errorIdentifier:"",invalidSubscriptions:t,errorMessage:""}:s?(()=>{var e,s;const t=(0,C.select)(Re);if(t.selectUsageCountStatus()!==ke)return null;const o=t.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:""}},[]),q=(0,l.useCallback)(()=>{o(so.inactive)},[]),U=(0,l.useCallback)(()=>F(null),[]),W=(0,l.useCallback)(()=>{F(null),o(so.generate)},[]),H=(0,l.useCallback)(()=>{F($({currentSubscriptions:p,isSeoAnalysisActive:v})),o(so.inactive)},[$,p,v]),z=(0,l.useCallback)(e=>{F(e),o(so.inactive)},[]),D={onClose:q,closeButtonScreenReaderText:L},K=(0,l.useCallback)(()=>!(0===f.replace(Ct,"").trim().length),[f]),G=Yt(!1),Y=(0,l.useCallback)(()=>{E(),"pre-publish"===n&&G(),setTimeout(()=>(e=>{const s=`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 t=document.getElementById(s);t&&t.focus()})(n),0)},[E,n,G]),V=(0,l.useCallback)(()=>j?w&&x:x,[x,w,j]),Z=(0,l.useCallback)(async()=>{if(e(),!v)return void H();if(!K())return o(so.inactive),void Y();const s=V();if(!s&&b&&S&&j)return void H();if(!s&&b&&!j)return void H();if(!c&&(_||s))return void o(so.askConsent);M(!0);const{type:t,payload:r}=await R({endpoint:y,isWooProductEntity:j}),i=429===(null==r?void 0:r.errorCode)&&!(null!=r&&r.errorIdentifier)&&0===(null==r?void 0:r.missingLicenses.length),n=429===(null==r?void 0:r.errorCode)&&"USAGE_LIMIT_REACHED"===(null==r?void 0:r.errorIdentifier)||r.count>=r.limit;M(!1),i?H():403!==(null==r?void 0:r.errorCode)||!_&&!s?t!==Ut||429===(null==r?void 0:r.errorCode)||403===(null==r?void 0:r.errorCode)?t===Ut&&429===(null==r?void 0:r.errorCode)&&s?H():!s&&!_||!s&&n?o(so.upsell):(s&&c&&o(so.generate),!s&&_&&!n&&c&&o(so.generate)):H():o(so.askConsent)},[e,b,_,c,v,K,Y,H,y,R,S,j,N]),Q=(0,l.useCallback)(async()=>{const{type:e,payload:s}=await R({endpoint:y,isWooProductEntity:j}),t=429===(null==s?void 0:s.errorCode)||s.count>=s.limit,r=V();!t||r?e!==Ut?o(so.generate):H():o(so.upsell)},[o,H,y,R,V,j]),X=(0,l.useCallback)(()=>{o(c?so.generate:so.askConsent)},[o,c]),J=(0,l.useMemo)(()=>"google"===i?"title"===r?(0,s.__)("Generate SEO title","wordpress-seo"):(0,s.__)("Generate meta description","wordpress-seo"):"social"===i||"twitter"===i?"title"===r?(0,s.__)("Generate social title","wordpress-seo"):(0,s.__)("Generate social description","wordpress-seo"):void 0,[i,r]);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(I.Button,{type:"button",variant:"ai-secondary",size:"small",id:`yst-replacevar__use-ai-button__${r}__${n}`,onClick:Z,disabled:h===ve||!d,isLoading:N&&h===ve,children:J}),(0,u.jsxs)(eo,{...D,isOpen:[so.askConsent,so.upsell].includes(t),children:[t===so.askConsent&&(0,u.jsx)(Dt,{onStartGenerating:Q}),t===so.upsell&&(0,u.jsx)(Xt,{onActivateFreeSparks:X})]}),(0,u.jsx)(Jt,{...D,isOpen:t===so.generate,aiModalHelperLink:k,panelRef:O,title:a,children:t===so.generate&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Ot.UsageCounter,{limit:g,requests:m,isSkeleton:!1,className:"yst-absolute yst-top-[-11px] yst-end-12 sm:yst-end-16",mentionBetaInTooltip:b,mentionResetInTooltip:b}),(0,u.jsx)(Qt,{height:T,onFatalError:z})]})}),B&&(0,u.jsx)(Tt,{isOpen:!0,errorCode:B.errorCode,errorIdentifier:B.errorIdentifier,invalidSubscriptions:B.invalidSubscriptions,errorMessage:B.errorMessage,showActions:!0,onRetry:W,onClose:U})]})}).propTypes={onUseAi:a().func.isRequired};const to=window.yoast.searchMetadataPreviews,oo=({title:e,description:t,status:o,titleForLength:r,showPreviewSkeleton:i,showLengthProgress:n})=>{const a=(0,C.useSelect)(e=>e(Ee).getSnippetEditorMode(),[]),[c,d]=(0,l.useState)(a),{editType:p}=It(),h=ft(),m=Rr({editType:p,title:r,description:t});return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(to.ModeSwitcher,{onChange:d,active:c,id:`yst-ai-google-preview-mode-switcher-${h}`,disabled:o===Fe.loading}),i?(0,u.jsx)(no,{}):(0,u.jsx)(io,{mode:c,title:e,description:t}),(0,u.jsxs)("div",{className:"yst-pt-4",children:[(0,u.jsx)(I.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:p===Me?(0,s.__)("SEO title width","wordpress-seo"):(0,s.__)("Meta description length","wordpress-seo")}),(0,u.jsx)(ao,{className:"yst-mt-2",progress:n?m.actual:0,min:0,max:m.max,score:m.score})]})]})};oo.propTypes={title:a().string.isRequired,description:a().string.isRequired,status:a().oneOf(Object.keys(Fe)).isRequired,titleForLength:a().string.isRequired,showPreviewSkeleton:a().bool.isRequired,showLengthProgress:a().bool.isRequired};const ro=/mobi/i,io=({mode:e,title:s,description:t})=>{var o,r;const n=(0,C.useSelect)(e=>e(Ee).getBaseUrlFromSettings(),[]),a=(0,C.useSelect)(e=>e(Ee).getSnippetEditorData().slug||"",[]),c=(0,C.useSelect)(e=>e(Ee).getDateFromSettings(),[]),d=(0,C.useSelect)(e=>e(Ee).getFocusKeyphrase(),[]),p=(0,C.useSelect)(e=>e(Ee).getSnippetEditorPreviewImageUrl(),[]),h=(0,C.useSelect)(e=>e(Ee).getSiteIconUrlFromSettings(),[]),m=(0,C.useSelect)(e=>e(Ee).getShoppingData(),[]),g=(0,C.useSelect)(e=>e(Ee).getSnippetEditorWordsToHighlight(),[]),y=(0,C.useSelect)(e=>e(Ee).getSiteName(),[]),x=(0,C.useSelect)(e=>e(Ee).getContentLocale(),[]),w=(0,l.useMemo)(()=>n+a,[n,a]),f=(0,l.useMemo)(()=>{var e,s;return ro.test(null===(e=window)||void 0===e||null===(s=e.navigator)||void 0===s?void 0:s.userAgent)},[null===(o=window)||void 0===o||null===(r=o.navigator)||void 0===r?void 0:r.userAgent]);return(0,u.jsx)("div",{className:`yst-ai-generator-preview-section ${e}${f?" yst-user-agent__mobile":""}`,children:(0,u.jsx)(to.SnippetPreview,{title:s,description:t,mode:e,url:w,keyword:d,date:c,faviconSrc:h,mobileImageSrc:p,wordsToHighlight:g,siteName:y,locale:x,shoppingData:m,onMouseUp:i.noop})})};io.propTypes={mode:a().oneOf(Object.keys({mobile:"mobile",desktop:"desktop"})).isRequired,title:a().string.isRequired,description:a().string.isRequired};const no=()=>(0,u.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,u.jsxs)("div",{className:"yst-flex yst-gap-x-3",children:[(0,u.jsx)(I.SkeletonLoader,{className:"yst-flex-shrink-0 yst-h-7 yst-w-7 yst-rounded-full"}),(0,u.jsxs)("div",{className:"yst-flex yst-flex-col yst-w-full yst-gap-y-1",children:[(0,u.jsx)(I.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,u.jsx)(I.SkeletonLoader,{className:"yst-h-2.5 yst-w-10/12"})]})]}),(0,u.jsx)(I.SkeletonLoader,{className:"yst-h-4 yst-w-full yst-mt-6 yst-mb-4"}),(0,u.jsx)(I.SkeletonLoader,{className:"yst-h-3 yst-w-full"}),(0,u.jsx)(I.SkeletonLoader,{className:"yst-h-3 yst-w-10/12 yst-mt-2.5"})]}),ao=({className:e="",progress:s,max:t,score:o})=>{const r=(0,l.useMemo)(()=>(e=>e>=7?"yst-score-good":e>=5?"yst-score-ok":"yst-score-bad")(o),[o]);return(0,u.jsx)(I.ProgressBar,{className:he()("yst-length-progress-bar",r,e),progress:s,min:0,max:t})};ao.propTypes={className:a().string,progress:a().number.isRequired,max:a().number.isRequired,score:a().number.isRequired};const lo=({title:e,description:t,showPreviewSkeleton:o})=>(0,u.jsxs)("div",{children:[(0,u.jsx)("div",{className:"yst-flex yst-mb-6",children:(0,u.jsx)(I.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:(0,s.__)("Social preview","wordpress-seo")})}),o?(0,u.jsx)(or,{}):(0,u.jsx)(tr,{title:e,description:t})]});lo.propTypes={title:a().string.isRequired,description:a().string.isRequired,showPreviewSkeleton:a().bool.isRequired};const co=d().p`
115 205 color: #606770;
116 206 flex-shrink: 0;
117 207 font-size: 12px;
118 208 line-height: 16px;
@@ -122,9 +212,9 @@
122 212 text-transform: uppercase;
123 213 white-space: nowrap;
124 214 margin: 0;
125 215 position: ${e=>"landscape"===e.mode?"relative":"static"};
126 -`,dt=e=>{const{siteUrl:s}=e;return(0,u.jsxs)(D.Fragment,{children:[(0,u.jsx)("span",{className:"screen-reader-text",children:s}),(0,u.jsx)(ct,{"aria-hidden":"true",children:(0,u.jsx)("span",{children:s})})]})};dt.propTypes={siteUrl:a().string.isRequired};const ut=dt,pt=window.yoast.socialMetadataForms,mt=d().img`
216 +`,uo=e=>{const{siteUrl:s}=e;return(0,u.jsxs)(Q.Fragment,{children:[(0,u.jsx)("span",{className:"screen-reader-text",children:s}),(0,u.jsx)(co,{"aria-hidden":"true",children:(0,u.jsx)("span",{children:s})})]})};uo.propTypes={siteUrl:a().string.isRequired};const po=uo,ho=window.yoast.socialMetadataForms,mo=d().img`
127 217 && {
128 218 max-width: ${e=>e.width}px;
129 219 height: ${e=>e.height}px;
130 220 position: absolute;
@@ -132,9 +222,9 @@
132 222 left: 50%;
133 223 transform: translate(-50%, -50%);
134 224 max-width: none;
135 225 }
136 -`,ht=d().img`
226 +`,go=d().img`
137 227 && {
138 228 height: 100%;
139 229 position: absolute;
140 230 width: 100%;
@@ -139,20 +229,20 @@
139 229 position: absolute;
140 230 width: 100%;
141 231 object-fit: cover;
142 232 }
143 -`,gt=d().div`
233 +`,yo=d().div`
144 234 padding-bottom: ${e=>e.aspectRatio}%;
145 -`,yt=({imageProps:e,width:s,height:t,imageMode:r="landscape"})=>"landscape"===r?(0,u.jsx)(gt,{aspectRatio:e.aspectRatio,children:(0,u.jsx)(ht,{src:e.src,alt:e.alt})}):(0,u.jsx)(mt,{src:e.src,alt:e.alt,width:s,height:t,imageProperties:e});function xt(e,s,t){return"landscape"===t?{widthRatio:s.width/e.landscapeWidth,heightRatio:s.height/e.landscapeHeight}:"portrait"===t?{widthRatio:s.width/e.portraitWidth,heightRatio:s.height/e.portraitHeight}:{widthRatio:s.width/e.squareWidth,heightRatio:s.height/e.squareHeight}}function wt(e,s){return s.widthRatio<=s.heightRatio?{width:Math.round(e.width/s.widthRatio),height:Math.round(e.height/s.widthRatio)}:{width:Math.round(e.width/s.heightRatio),height:Math.round(e.height/s.heightRatio)}}async function ft(e,s,t=!1){const r=await function(e){return new Promise((s,t)=>{const r=new Image;r.onload=()=>{s({width:r.width,height:r.height})},r.onerror=t,r.src=e})}(e);let o=t?"landscape":"square";"Facebook"===s&&(o=(0,pt.determineFacebookImageMode)(r));const i=function(e){return"Twitter"===e?pt.TWITTER_IMAGE_SIZES:pt.FACEBOOK_IMAGE_SIZES}(s),n=function(e,s,t){return"square"===t&&s.width===s.height?{width:e.squareWidth,height:e.squareHeight}:wt(s,xt(e,s,t))}(i,r,o);return{mode:o,height:n.height,width:n.width}}async function bt(e,s,t=!1){try{return{imageProperties:await ft(e,s,t),status:"loaded"}}catch(e){return{imageProperties:null,status:"errored"}}}yt.propTypes={imageProps:a().shape({src:a().string.isRequired,alt:a().string.isRequired,aspectRatio:a().number.isRequired}).isRequired,width:a().number.isRequired,height:a().number.isRequired,imageMode:a().string};const vt=d().div`
235 +`,xo=({imageProps:e,width:s,height:t,imageMode:o="landscape"})=>"landscape"===o?(0,u.jsx)(yo,{aspectRatio:e.aspectRatio,children:(0,u.jsx)(go,{src:e.src,alt:e.alt})}):(0,u.jsx)(mo,{src:e.src,alt:e.alt,width:s,height:t,imageProperties:e});function wo(e,s,t){return"landscape"===t?{widthRatio:s.width/e.landscapeWidth,heightRatio:s.height/e.landscapeHeight}:"portrait"===t?{widthRatio:s.width/e.portraitWidth,heightRatio:s.height/e.portraitHeight}:{widthRatio:s.width/e.squareWidth,heightRatio:s.height/e.squareHeight}}function fo(e,s){return s.widthRatio<=s.heightRatio?{width:Math.round(e.width/s.widthRatio),height:Math.round(e.height/s.widthRatio)}:{width:Math.round(e.width/s.heightRatio),height:Math.round(e.height/s.heightRatio)}}async function bo(e,s,t=!1){const o=await function(e){return new Promise((s,t)=>{const o=new Image;o.onload=()=>{s({width:o.width,height:o.height})},o.onerror=t,o.src=e})}(e);let r=t?"landscape":"square";"Facebook"===s&&(r=(0,ho.determineFacebookImageMode)(o));const i=function(e){return"Twitter"===e?ho.TWITTER_IMAGE_SIZES:ho.FACEBOOK_IMAGE_SIZES}(s),n=function(e,s,t){return"square"===t&&s.width===s.height?{width:e.squareWidth,height:e.squareHeight}:fo(s,wo(e,s,t))}(i,o,r);return{mode:r,height:n.height,width:n.width}}async function vo(e,s,t=!1){try{return{imageProperties:await bo(e,s,t),status:"loaded"}}catch(e){return{imageProperties:null,status:"errored"}}}xo.propTypes={imageProps:a().shape({src:a().string.isRequired,alt:a().string.isRequired,aspectRatio:a().number.isRequired}).isRequired,width:a().number.isRequired,height:a().number.isRequired,imageMode:a().string};const ko=d().div`
146 236 position: relative;
147 237 ${e=>"landscape"===e.mode?`max-width: ${e.dimensions.width}`:`min-width: ${e.dimensions.width}; height: ${e.dimensions.height}`};
148 238 overflow: hidden;
149 - background-color: ${Ee.colors.$color_white};
150 -`,kt=d().div`
239 + background-color: ${g.colors.$color_white};
240 +`,jo=d().div`
151 241 box-sizing: border-box;
152 - max-width: ${pt.FACEBOOK_IMAGE_SIZES.landscapeWidth}px;
153 - height: ${pt.FACEBOOK_IMAGE_SIZES.landscapeHeight}px;
154 - background-color: ${Ee.colors.$color_grey};
242 + max-width: ${ho.FACEBOOK_IMAGE_SIZES.landscapeWidth}px;
243 + height: ${ho.FACEBOOK_IMAGE_SIZES.landscapeHeight}px;
244 + background-color: ${g.colors.$color_grey};
155 245 border-style: dashed;
156 246 border-width: 1px;
157 247 // We're not using standard colors to increase contrast for accessibility.
158 248 color: #006DAC;
@@ -163,9 +253,9 @@
163 253 align-items: center;
164 254 text-decoration: underline;
165 255 font-size: 14px;
166 256 cursor: pointer;
167 -`;class _t extends D.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 bt(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:pt.FACEBOOK_IMAGE_SIZES.squareHeight+"px",width:pt.FACEBOOK_IMAGE_SIZES.squareWidth+"px"};case"portrait":return{height:pt.FACEBOOK_IMAGE_SIZES.portraitHeight+"px",width:pt.FACEBOOK_IMAGE_SIZES.portraitWidth+"px"};case"landscape":return{height:pt.FACEBOOK_IMAGE_SIZES.landscapeHeight+"px",width:pt.FACEBOOK_IMAGE_SIZES.landscapeWidth+"px"}}}render(){const{imageProperties:e,status:t}=this.state;if("loading"===t||""===this.props.src||"errored"===t)return(0,u.jsx)(kt,{onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,s.__)("Select image","wordpress-seo")});const r=this.retrieveContainerDimensions(e.mode);return(0,u.jsx)(vt,{mode:e.mode,dimensions:r,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,onClick:this.props.onImageClick,children:(0,u.jsx)(yt,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:pt.FACEBOOK_IMAGE_SIZES.aspectRatio},width:e.width,height:e.height,imageMode:e.mode})})}}_t.propTypes={src:a().string,alt:a().string,onImageLoaded:a().func,onImageClick:a().func,onMouseEnter:a().func,onMouseLeave:a().func},_t.defaultProps={src:"",alt:"",onImageLoaded:i.noop,onImageClick:i.noop,onMouseEnter:i.noop,onMouseLeave:i.noop};const jt=_t,St=d().span`
257 +`;class _o extends Q.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 vo(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:ho.FACEBOOK_IMAGE_SIZES.squareHeight+"px",width:ho.FACEBOOK_IMAGE_SIZES.squareWidth+"px"};case"portrait":return{height:ho.FACEBOOK_IMAGE_SIZES.portraitHeight+"px",width:ho.FACEBOOK_IMAGE_SIZES.portraitWidth+"px"};case"landscape":return{height:ho.FACEBOOK_IMAGE_SIZES.landscapeHeight+"px",width:ho.FACEBOOK_IMAGE_SIZES.landscapeWidth+"px"}}}render(){const{imageProperties:e,status:t}=this.state;if("loading"===t||""===this.props.src||"errored"===t)return(0,u.jsx)(jo,{onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,s.__)("Select image","wordpress-seo")});const o=this.retrieveContainerDimensions(e.mode);return(0,u.jsx)(ko,{mode:e.mode,dimensions:o,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,onClick:this.props.onImageClick,children:(0,u.jsx)(xo,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:ho.FACEBOOK_IMAGE_SIZES.aspectRatio},width:e.width,height:e.height,imageMode:e.mode})})}}_o.propTypes={src:a().string,alt:a().string,onImageLoaded:a().func,onImageClick:a().func,onMouseEnter:a().func,onMouseLeave:a().func},_o.defaultProps={src:"",alt:"",onImageLoaded:i.noop,onImageClick:i.noop,onMouseEnter:i.noop,onMouseLeave:i.noop};const So=_o,Co=d().span`
168 258 line-height: ${20}px;
169 259 min-height : ${20}px;
170 260 color: #1d2129;
171 261 font-weight: 600;
@@ -179,9 +269,9 @@
179 269 display: -webkit-box;
180 270 -webkit-line-clamp: ${e=>e.lineCount};
181 271 -webkit-box-orient: vertical;
182 272 overflow: hidden;
183 -`,Ct=d().p`
273 +`,Ro=d().p`
184 274 line-height: ${16}px;
185 275 min-height : ${16}px;
186 276 color: #606770;
187 277 font-size: 14px;
@@ -196,15 +286,15 @@
196 286
197 287 @media all and ( max-width: ${e=>e.maxWidth} ) {
198 288 display: none;
199 289 }
200 -`,Rt=e=>{switch(e){case"landscape":return"527px";case"square":case"portrait":return"369px";default:return"476px"}},Et=d().div`
290 +`,Eo=e=>{switch(e){case"landscape":return"527px";case"square":case"portrait":return"369px";default:return"476px"}},Lo=d().div`
201 291 box-sizing: border-box;
202 292 display: flex;
203 293 flex-direction: ${e=>"landscape"===e.mode?"column":"row"};
204 294 background-color: #f2f3f5;
205 295 max-width: 527px;
206 -`,Lt=d().div`
296 +`,No=d().div`
207 297 box-sizing: border-box;
208 298 background-color: #f2f3f5;
209 299 margin: 0;
210 300 padding: 10px 12px;
@@ -218,9 +308,9 @@
218 308 flex-grow: 1;
219 309 justify-content: ${e=>"landscape"===e.mode?"flex-start":"center"};
220 310 font-size: 12px;
221 311 overflow: hidden;
222 -`;class Nt extends D.Component{constructor(e){super(e),this.state={imageMode:null,maxLineCount:0,descriptionLineCount:0},this.facebookTitleRef=K().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:s}=this.state,t="landscape"===e?2:5;t!==s&&this.setState({maxLineCount:t})}maybeSetDescriptionLineCount(){const{descriptionLineCount:e,maxLineCount:s,imageMode:t}=this.state,r=this.getTitleLineCount();let o=s-r;"portrait"===t&&(o=5===r?0:4),o!==e&&this.setState({descriptionLineCount:o})}componentDidUpdate(){this.maybeSetMaxLineCount(),this.maybeSetDescriptionLineCount()}render(){const{imageMode:e,maxLineCount:s,descriptionLineCount:t}=this.state;return(0,u.jsxs)(Et,{id:"facebookPreview",mode:e,children:[(0,u.jsx)(jt,{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,u.jsxs)(Lt,{mode:e,children:[(0,u.jsx)(ut,{siteUrl:this.props.siteUrl,mode:e}),(0,u.jsx)(St,{ref:this.facebookTitleRef,onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle,lineCount:s,children:this.props.title}),t>0&&(0,u.jsx)(Ct,{maxWidth:Rt(e),onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription,lineCount:t,children:this.props.description})]})]})}}Nt.propTypes={siteUrl:a().string.isRequired,title:a().string.isRequired,description:a().string,imageUrl:a().string,imageFallbackUrl:a().string,alt:a().string,onSelect:a().func,onImageClick:a().func,onMouseHover:a().func},Nt.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{}};const Mt=Nt,It=d().div`
312 +`;class Io extends Q.Component{constructor(e){super(e),this.state={imageMode:null,maxLineCount:0,descriptionLineCount:0},this.facebookTitleRef=X().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:s}=this.state,t="landscape"===e?2:5;t!==s&&this.setState({maxLineCount:t})}maybeSetDescriptionLineCount(){const{descriptionLineCount:e,maxLineCount:s,imageMode:t}=this.state,o=this.getTitleLineCount();let r=s-o;"portrait"===t&&(r=5===o?0:4),r!==e&&this.setState({descriptionLineCount:r})}componentDidUpdate(){this.maybeSetMaxLineCount(),this.maybeSetDescriptionLineCount()}render(){const{imageMode:e,maxLineCount:s,descriptionLineCount:t}=this.state;return(0,u.jsxs)(Lo,{id:"facebookPreview",mode:e,children:[(0,u.jsx)(So,{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,u.jsxs)(No,{mode:e,children:[(0,u.jsx)(po,{siteUrl:this.props.siteUrl,mode:e}),(0,u.jsx)(Co,{ref:this.facebookTitleRef,onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle,lineCount:s,children:this.props.title}),t>0&&(0,u.jsx)(Ro,{maxWidth:Eo(e),onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription,lineCount:t,children:this.props.description})]})]})}}Io.propTypes={siteUrl:a().string.isRequired,title:a().string.isRequired,description:a().string,imageUrl:a().string,imageFallbackUrl:a().string,alt:a().string,onSelect:a().func,onImageClick:a().func,onMouseHover:a().func},Io.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{}};const Mo=Io,To=d().div`
223 313 text-transform: lowercase;
224 314 color: rgb(83, 100, 113);
225 315 white-space: nowrap;
226 316 overflow: hidden;
@@ -229,16 +319,16 @@
229 319 fill: currentcolor;
230 320 display: flex;
231 321 flex-direction: row;
232 322 align-items: flex-end;
233 -`,Tt=e=>(0,u.jsx)(It,{children:(0,u.jsx)("span",{children:e.siteUrl})});Tt.propTypes={siteUrl:a().string.isRequired};const Pt=Tt,At=(e,s=!0)=>e?`\n\t\t\tmax-width: ${pt.TWITTER_IMAGE_SIZES.landscapeWidth}px;\n\t\t\t${s?"border-bottom: 1px solid #E1E8ED;":""}\n\t\t\tborder-radius: 14px 14px 0 0;\n\t\t\t`:`\n\t\twidth: ${pt.TWITTER_IMAGE_SIZES.squareWidth}px;\n\t\t${s?"border-right: 1px solid #E1E8ED;":""}\n\t\tborder-radius: 14px 0 0 14px;\n\t\t`,Ot=d().div`
323 +`,Ao=e=>(0,u.jsx)(To,{children:(0,u.jsx)("span",{children:e.siteUrl})});Ao.propTypes={siteUrl:a().string.isRequired};const Po=Ao,Oo=(e,s=!0)=>e?`\n\t\t\tmax-width: ${ho.TWITTER_IMAGE_SIZES.landscapeWidth}px;\n\t\t\t${s?"border-bottom: 1px solid #E1E8ED;":""}\n\t\t\tborder-radius: 14px 14px 0 0;\n\t\t\t`:`\n\t\twidth: ${ho.TWITTER_IMAGE_SIZES.squareWidth}px;\n\t\t${s?"border-right: 1px solid #E1E8ED;":""}\n\t\tborder-radius: 14px 0 0 14px;\n\t\t`,Bo=d().div`
234 324 position: relative;
235 325 box-sizing: content-box;
236 326 overflow: hidden;
237 327 background-color: #e1e8ed;
238 328 flex-shrink: 0;
239 - ${e=>At(e.isLarge)}
240 -`,Bt=d().div`
329 + ${e=>Oo(e.isLarge)}
330 +`,Fo=d().div`
241 331 display: flex;
242 332 justify-content: center;
243 333 align-items: center;
244 334 box-sizing: border-box;
@@ -246,11 +336,11 @@
246 336 margin: 0;
247 337 padding: 1em;
248 338 text-align: center;
249 339 font-size: 1rem;
250 - ${e=>At(e.isLarge,!1)}
251 -`,Ft=d()(Bt)`
252 - ${e=>e.isLarge&&`height: ${pt.TWITTER_IMAGE_SIZES.landscapeHeight}px;`}
340 + ${e=>Oo(e.isLarge,!1)}
341 +`,$o=d()(Fo)`
342 + ${e=>e.isLarge&&`height: ${ho.TWITTER_IMAGE_SIZES.landscapeHeight}px;`}
253 343 border-top-left-radius: 14px;
254 344 ${e=>e.isLarge?"border-top-right-radius":"border-bottom-left-radius"}: 14px;
255 345 border-style: dashed;
256 346 border-width: 1px;
@@ -260,9 +350,9 @@
260 350 background-color: #f1f1f1;
261 351 text-decoration: underline;
262 352 font-size: 14px;
263 353 cursor: pointer;
264 -`;class qt extends K().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 bt(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,u.jsx)(Ft,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,s.__)("Select image","wordpress-seo")}):(0,u.jsx)(Ot,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,u.jsx)(yt,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:pt.TWITTER_IMAGE_SIZES.aspectRatio},width:t.width,height:t.height,imageMode:t.mode})})}}qt.propTypes={isLarge:a().bool.isRequired,src:a().string,alt:a().string,onImageClick:a().func,onMouseEnter:a().func,onMouseLeave:a().func},qt.defaultProps={src:"",alt:"",onMouseEnter:i.noop,onImageClick:i.noop,onMouseLeave:i.noop};const $t=d().div`
354 +`;class qo extends X().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 vo(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,u.jsx)($o,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,s.__)("Select image","wordpress-seo")}):(0,u.jsx)(Bo,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,u.jsx)(xo,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:ho.TWITTER_IMAGE_SIZES.aspectRatio},width:t.width,height:t.height,imageMode:t.mode})})}}qo.propTypes={isLarge:a().bool.isRequired,src:a().string,alt:a().string,onImageClick:a().func,onMouseEnter:a().func,onMouseLeave:a().func},qo.defaultProps={src:"",alt:"",onMouseEnter:i.noop,onImageClick:i.noop,onMouseLeave:i.noop};const Uo=d().div`
265 355 display: flex;
266 356 flex-direction: column;
267 357 padding: 12px;
268 358 justify-content: center;
@@ -275,9 +365,9 @@
275 365 line-height:20px;
276 366 min-height:20px;
277 367 font-size:15px;
278 368 }
279 -`,Ut=e=>(0,u.jsx)($t,{children:e.children});Ut.propTypes={children:a().array.isRequired};const Wt=Ut,Ht=d().p`
369 +`,Wo=e=>(0,u.jsx)(Uo,{children:e.children});Wo.propTypes={children:a().array.isRequired};const Ho=Wo,zo=d().p`
280 370 white-space: nowrap;
281 371 overflow: hidden;
282 372 text-overflow: ellipsis;
283 373 margin: 0;
@@ -282,9 +372,9 @@
282 372 text-overflow: ellipsis;
283 373 margin: 0;
284 374 color: rgb(15, 20, 25);
285 375 cursor: pointer;
286 -`,zt=d().p`
376 +`,Do=d().p`
287 377 max-height: 55px;
288 378 overflow: hidden;
289 379 text-overflow: ellipsis;
290 380 margin: 0;
@@ -293,12 +383,12 @@
293 383 cursor: pointer;
294 384 -webkit-line-clamp: 2;
295 385 -webkit-box-orient: vertical;
296 386
297 - @media all and ( max-width: ${pt.TWITTER_IMAGE_SIZES.landscapeWidth}px ) {
387 + @media all and ( max-width: ${ho.TWITTER_IMAGE_SIZES.landscapeWidth}px ) {
298 388 display: none;
299 389 }
300 -`,Dt=d().div`
390 +`,Ko=d().div`
301 391 font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
302 392 font-size: 15px;
303 393 font-weight: 400;
304 394 line-height: 20px;
@@ -314,62 +404,62 @@
314 404 &:hover {
315 405 background: #f5f8fa;
316 406 border: 1px solid rgba(136,153,166,.5);
317 407 }
318 -`,Kt=d()(Dt)`
408 +`,Go=d()(Ko)`
319 409 flex-direction: column;
320 410 max-height: 370px;
321 -`,Gt=d()(Dt)`
411 +`,Yo=d()(Ko)`
322 412 flex-direction: row;
323 413 height: 125px;
324 -`;class Yt extends D.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:s,imageFallbackUrl:t,alt:r,title:o,description:i,siteUrl:n}=this.props,a=e?Kt:Gt;return(0,u.jsxs)(a,{id:"twitterPreview",children:[(0,u.jsx)(qt,{src:s||t,alt:r,isLarge:e,onImageClick:this.props.onImageClick,onMouseEnter:this.onImageEnter,onMouseLeave:this.onLeave}),(0,u.jsxs)(Wt,{children:[(0,u.jsx)(Pt,{siteUrl:n}),(0,u.jsx)(Ht,{onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle,children:o}),(0,u.jsx)(zt,{onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription,children:i})]})]})}}Yt.propTypes={siteUrl:a().string.isRequired,title:a().string.isRequired,description:a().string,isLarge:a().bool,imageUrl:a().string,imageFallbackUrl:a().string,alt:a().string,onSelect:a().func,onImageClick:a().func,onMouseHover:a().func},Yt.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{},isLarge:!0};const Vt=Yt,Zt=window.yoast.replacementVariableEditor;class Qt extends D.Component{constructor(e){super(e),this.state={activeField:"",hoveredField:""},this.SocialPreview="Social"===e.socialMediumName?Mt:Vt,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,s){switch(e){case"title":this.titleEditorRef=s;break;case"description":this.descriptionEditorRef=s}}render(){const{onDescriptionChange:e,onTitleChange:s,onSelectImageClick:t,onRemoveImageClick:o,socialMediumName:i,imageWarnings:n,siteUrl:a,description:l,descriptionInputPlaceholder:c,descriptionPreviewFallback:d,imageUrl:p,imageFallbackUrl:m,alt:h,title:g,titleInputPlaceholder:y,titlePreviewFallback:x,replacementVariables:w,recommendedReplacementVariables:f,applyReplacementVariables:b,onReplacementVariableSearchChange:v,isPremium:k,isLarge:_,socialPreviewLabel:j,idSuffix:S,activeMetaTabId:C}=this.props,R=b({title:g||x,description:l||d});return(0,u.jsxs)(K().Fragment,{children:[j&&(0,u.jsx)(r.SimulatedLabel,{children:j}),(0,u.jsx)(this.SocialPreview,{onMouseHover:this.setHoveredField,onSelect:this.setActiveField,onImageClick:t,siteUrl:a,title:R.title,description:R.description,imageUrl:p,imageFallbackUrl:m,alt:h,isLarge:_,activeMetaTabId:C}),(0,u.jsx)(pt.SocialMetadataPreviewForm,{onDescriptionChange:e,socialMediumName:i,title:g,titleInputPlaceholder:y,onRemoveImageClick:o,imageSelected:!!p,imageUrl:p,imageFallbackUrl:m,onTitleChange:s,onSelectImageClick:t,description:l,descriptionInputPlaceholder:c,imageWarnings:n,replacementVariables:w,recommendedReplacementVariables:f,onReplacementVariableSearchChange:v,onMouseHover:this.setHoveredField,hoveredField:this.state.hoveredField,onSelect:this.setActiveField,activeField:this.state.activeField,isPremium:k,setEditorRef:this.setEditorRef,idSuffix:S})]})}}Qt.propTypes={title:a().string.isRequired,onTitleChange:a().func.isRequired,description:a().string.isRequired,onDescriptionChange:a().func.isRequired,imageUrl:a().string.isRequired,imageFallbackUrl:a().string.isRequired,onSelectImageClick:a().func.isRequired,onRemoveImageClick:a().func.isRequired,socialMediumName:a().string.isRequired,alt:a().string,isPremium:a().bool,imageWarnings:a().array,isLarge:a().bool,siteUrl:a().string,descriptionInputPlaceholder:a().string,titleInputPlaceholder:a().string,descriptionPreviewFallback:a().string,titlePreviewFallback:a().string,replacementVariables:Zt.replacementVariablesShape,recommendedReplacementVariables:Zt.recommendedReplacementVariablesShape,applyReplacementVariables:a().func,onReplacementVariableSearchChange:a().func,socialPreviewLabel:a().string,idSuffix:a().string,activeMetaTabId:a().string},Qt.defaultProps={imageWarnings:[],recommendedReplacementVariables:[],replacementVariables:[],isPremium:!1,isLarge:!0,siteUrl:"",descriptionInputPlaceholder:"",titleInputPlaceholder:"",descriptionPreviewFallback:"",titlePreviewFallback:"",alt:"",applyReplacementVariables:e=>e,onReplacementVariableSearchChange:null,socialPreviewLabel:"",idSuffix:"",activeMetaTabId:""};const Jt={},Xt=(e,s,{log:t=console.warn}={})=>{Jt[e]||(Jt[e]=!0,t(s))},er=(e,s=i.noop)=>{const t={};for(const r in e)Object.hasOwn(e,r)&&Object.defineProperty(t,r,{set:t=>{e[r]=t,s("set",r,t)},get:()=>(s("get",r),e[r])});return t};er({squareWidth:125,squareHeight:125,landscapeWidth:506,landscapeHeight:265,aspectRatio:50.2},(e,s)=>Xt(`@yoast/social-metadata-previews/TWITTER_IMAGE_SIZES/${e}/${s}`,`[@yoast/social-metadata-previews] "TWITTER_IMAGE_SIZES.${s}" is deprecated and will be removed in the future, please use this from @yoast/social-metadata-forms instead.`)),er({squareWidth:158,squareHeight:158,landscapeWidth:527,landscapeHeight:273,portraitWidth:158,portraitHeight:237,aspectRatio:52.2,largeThreshold:{width:446,height:233}},(e,s)=>Xt(`@yoast/social-metadata-previews/FACEBOOK_IMAGE_SIZES/${e}/${s}`,`[@yoast/social-metadata-previews] "FACEBOOK_IMAGE_SIZES.${s}" is deprecated and will be removed in the future, please use this from @yoast/social-metadata-forms instead.`));const sr=({title:e,description:s})=>{const t=(0,k.useSelect)(e=>e(os).getSiteUrl(),[]),r=(0,k.useSelect)(e=>e(os).getFacebookImageUrl(),[]),o=(0,k.useSelect)(e=>e(os).getEditorDataImageFallback(),[]),n=(0,k.useSelect)(e=>e(os).getFacebookAltText(),[]);return(0,u.jsx)("div",{className:"yst-ai-generator-preview-section",children:(0,u.jsx)(Mt,{title:e,description:s,siteUrl:t,imageUrl:r,imageFallbackUrl:o,alt:n,onSelect:i.noop,onImageClick:i.noop,onMouseHover:i.noop})})};sr.propTypes={title:a().string.isRequired,description:a().string.isRequired};const tr=()=>(0,u.jsxs)("div",{className:"yst-flex yst-flex-col yst-w-[527px] yst-border yst-mx-auto",children:[(0,u.jsx)(R.SkeletonLoader,{className:"yst-h-[273px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,u.jsxs)("div",{className:"yst-w-full yst-p-4 yst-space-y-1",children:[(0,u.jsx)(R.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,u.jsx)(R.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,u.jsx)(R.SkeletonLoader,{className:"yst-h-3 yst-w-full"})]})]}),rr=({children:e,onRetry:t})=>{const{onClose:r}=(0,R.useModalContext)();return(0,u.jsxs)(l.Fragment,{children:[e,(0,u.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,u.jsx)(R.Button,{variant:"secondary",onClick:r,children:(0,s.__)("Close","wordpress-seo")}),(0,u.jsx)(R.Button,{variant:"primary",onClick:t,children:(0,s.__)("Try again","wordpress-seo")})]})]})};rr.propTypes={children:a().node.isRequired,onRetry:a().func.isRequired};const or=({errorCode:e,errorIdentifier:s,invalidSubscriptions:t=[],showActions:r=!1,onRetry:o=i.noop,errorMessage:n=""})=>{switch(e){case 400:switch(s){case"AI_CONTENT_FILTER":return(0,u.jsx)(Hs,{});case"NOT_ENOUGH_CONTENT":return(0,u.jsx)(Fs,{});case"SITE_UNREACHABLE":return(0,u.jsx)(Ks,{});case"WP_HTTP_REQUEST_ERROR":return r?(0,u.jsx)(rr,{onRetry:o,children:(0,u.jsx)(zs,{errorMessage:n})}):(0,u.jsx)(zs,{errorMessage:n});default:return r?(0,u.jsx)(rr,{onRetry:o,children:(0,u.jsx)(Bs,{})}):(0,u.jsx)(Bs,{})}case 402:return(0,u.jsx)(Us,{invalidSubscriptions:t});case 408:return r?(0,u.jsx)(rr,{onRetry:o,children:(0,u.jsx)(Ws,{})}):(0,u.jsx)(Ws,{});case 429:return"USAGE_LIMIT_REACHED"===s?(0,u.jsx)(Us,{invalidSubscriptions:t}):(0,u.jsx)($s,{});case 410:return(0,u.jsx)(Ds,{});default:return r?(0,u.jsx)(rr,{onRetry:o,children:(0,u.jsx)(Bs,{})}):(0,u.jsx)(Bs,{})}};or.propTypes={errorCode:a().number.isRequired,errorIdentifier:a().string.isRequired,invalidSubscriptions:a().array,showActions:a().bool,onRetry:a().func,errorMessage:a().string};const ir=a().shape({value:a().string.isRequired,label:a().node.isRequired}),nr=({id:e,name:s,suggestion:t,isChecked:r,onChange:o})=>{const i=(0,l.useCallback)(()=>o(t.value),[t,o]);return(0,u.jsxs)("label",{htmlFor:e,className:ae()("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,u.jsx)("input",{type:"radio",id:e,name:s,className:"yst-radio__input",value:t.value,checked:r,onChange:i}),(0,u.jsx)("div",{className:ae()("yst-label yst-radio__label yst-flex yst-flex-wrap yst-items-center",!r&&"yst-text-slate-600"),children:t.label})]})};nr.propTypes={id:a().string.isRequired,name:a().string.isRequired,suggestion:ir.isRequired,isChecked:a().bool.isRequired,onChange:a().func.isRequired};const ar=({idSuffix:e,suggestions:s,selected:t,onChange:r})=>(0,u.jsx)("div",{children:(0,u.jsx)(R.RadioGroup,{className:"yst-suggestions-radio-group yst-flex yst-flex-col",id:`yst-ai-suggestions-radio-group__${e}`,children:s.map((s,o)=>(0,u.jsx)(nr,{id:`yst-ai-suggestions-radio-${e}__${o}`,name:`ai-suggestion__${e}`,isChecked:s.value===t,onChange:r,suggestion:s},`yst-ai-suggestions-radio-${e}__${o}`))})});ar.propTypes={idSuffix:a().string.isRequired,suggestions:a().arrayOf(ir).isRequired,selected:a().string.isRequired,onChange:a().func.isRequired};const lr=[["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"]],cr=({suggestionClassNames:e=lr})=>(0,u.jsx)("div",{className:"yst-flex yst-flex-col yst--space-y-[1px]",children:e.map((e,s)=>(0,u.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,u.jsx)("input",{type:"radio",disabled:!0,className:"yst-my-0.5"}),(0,u.jsx)("div",{className:"yst-flex yst-flex-col yst-w-full",children:e.map((e,t)=>(0,u.jsx)(R.SkeletonLoader,{className:e},`yst-ai-suggestion-radio-skeleton-${s}__${t}`))})]},`yst-ai-suggestion-radio-skeleton__${s}`))});cr.propTypes={suggestionClassNames:a().arrayOf(a().arrayOf(a().string))};const dr="ai_generator_tip_notification",ur=()=>{const e=(0,k.useSelect)(e=>e(os).isAlertDismissed(dr),[]),t=(0,k.useSelect)(e=>e(os).getEditorDataContent(),[]),r=(0,k.useSelect)(e=>e(os).getIsWooProductEntity(),[]),[o,,,i]=(0,R.useToggleState)(!1),{editType:n,contentType:a}=Es(),{dismissAlert:c}=(0,k.useDispatch)(os),d=(0,l.useCallback)(()=>{c(dr)},[c]),p=(0,l.useMemo)(()=>n===cs?(0,s.__)("%1$sTip%2$s: Improve the accuracy of your generated AI descriptions by writing more content in your page.","wordpress-seo"):(0,s.__)("%1$sTip%2$s: Improve the accuracy of your generated AI titles by writing more content in your page.","wordpress-seo")
325 -/* translators: %1$s and %2$s expand to opening and closing of a span in order to emphasise the word. */,[n]),m=(0,l.useMemo)(()=>((e,s)=>e||s===us?150:300)(r,a),[a,r]);return e||o||t.length>m?null:(0,u.jsxs)(R.Notifications.Notification,{id:"ai-generator-content-tip",variant:"info",dismissScreenReaderLabel:(0,s.__)("Dismiss","wordpress-seo"),children:[O((0,s.sprintf)(p,"<span>","</span>"),{span:(0,u.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})}),(0,u.jsxs)("div",{className:"yst-flex yst-mt-3 yst--ms-3 yst-gap-1",children:[(0,u.jsx)(R.Button,{type:"button",variant:"tertiary",onClick:d,children:(0,s.__)("Don’t show again","wordpress-seo")}),(0,u.jsx)(R.Button,{type:"button",variant:"tertiary",className:"yst-text-slate-800",onClick:i,children:(0,s.__)("Dismiss","wordpress-seo")})]})]})},pr=({title:e,description:t,showPreviewSkeleton:r})=>(0,u.jsxs)("div",{children:[(0,u.jsx)("div",{className:"yst-flex yst-mb-6",children:(0,u.jsx)(R.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:(0,s.__)("X preview","wordpress-seo")})}),r?(0,u.jsx)(hr,{}):(0,u.jsx)(mr,{title:e,description:t})]});pr.propTypes={title:a().string.isRequired,description:a().string.isRequired,showPreviewSkeleton:a().bool.isRequired};const mr=({title:e,description:s})=>{const t=(0,k.useSelect)(e=>e(os).getSiteUrl(),[]),r=(0,k.useSelect)(e=>e(os).getTwitterImageUrl(),[]),o=(0,k.useSelect)(e=>e(os).getFacebookImageUrl(),[]),n=(0,k.useSelect)(e=>e(os).getEditorDataImageFallback(),[]),a=(0,k.useSelect)(e=>e(os).getTwitterImageType(),[]),l=(0,k.useSelect)(e=>e(os).getTwitterAltText(),[]);return(0,u.jsx)("div",{className:"yst-ai-generator-preview-section",children:(0,u.jsx)(Vt,{title:e,description:s,siteUrl:t,imageUrl:r,imageFallbackUrl:o||n,isLarge:"summary"!==a,alt:l,onSelect:i.noop,onImageClick:i.noop,onMouseHover:i.noop})})};mr.propTypes={title:a().string.isRequired,description:a().string.isRequired};const hr=()=>(0,u.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,u.jsx)(R.SkeletonLoader,{className:"yst-h-[265px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,u.jsxs)("div",{className:"yst-w-full yst-p-4 yst-space-y-1",children:[(0,u.jsx)(R.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,u.jsx)(R.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,u.jsx)(R.SkeletonLoader,{className:"yst-h-3 yst-w-full"})]})]}),gr="yst-mt-1 yst-mb-3",yr="yst-flex yst-justify-end yst--me-8 yst-gap-3 yst--ms-2",xr=({onClose:e})=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("p",{className:gr,children:(0,s.__)("As long as this is a beta feature, you get unlimited sparks.","wordpress-seo")}),(0,u.jsx)("div",{className:yr,children:(0,u.jsx)(R.Button,{type:"button",variant:"primary",size:"small",onClick:e,children:(0,s.__)("Got it!","wordpress-seo")})})]}),wr=({onClose:e,upsellLink:t,isWooProductEntity:r=!1,ctbId:o="f6a84663-465f-4cb5-8ba5-f7a6d72224b2"})=>{const i=(0,R.useSvgAria)();return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("p",{className:gr,children:(0,s.sprintf)(/* translators: %s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ /* translators: %s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */
326 -(0,s.__)("Keep the momentum going, unlock unlimited sparks with %s!","wordpress-seo"),r?"Yoast WooCommerce SEO":"Yoast SEO Premium")}),(0,u.jsxs)("div",{className:yr,children:[(0,u.jsx)(R.Button,{type:"button",variant:"tertiary",size:"small",onClick:e,children:(0,s.__)("Close","wordpress-seo")}),(0,u.jsxs)(R.Button,{as:"a",size:"small",variant:"upsell",href:t,target:"_blank",rel:"noopener noreferrer","data-action":"load-nfd-ctb","data-ctb-id":o,children:[(0,u.jsx)(F(),{className:"yst-w-4 yst-h-4 yst--ms-1 yst-me-2 yst-shrink-0",...i}),(0,s.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. */
327 -(0,s.__)("Unlock with %1$s","wordpress-seo"),r?"Yoast WooCommerce SEO":"Yoast SEO Premium"),(0,u.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
328 -(0,s.__)("(Opens in a new browser tab)","wordpress-seo")})]})]})]})},fr=({className:e=""})=>{const{isUsageCountLimitReached:t,usageCount:r,usageCountLimit:o,premiumUpsellLink:i,wooUpsellLink:n,isWooProductEntity:a,hasValidPremiumSubscription:c,hasValidWooSubscription:d}=(0,k.useSelect)(e=>{const s=e(rs),t=e(os);return{isUsageCountLimitReached:s.isUsageCountLimitReached(),usageCount:s.selectUsageCount(),usageCountLimit:s.selectUsageCountLimit(),premiumUpsellLink:t.selectLink("https://yoa.st/ai-toast-out-of-free-sparks"),wooUpsellLink:t.selectLink("https://yoa.st/ai-toast-out-of-free-sparks-woo"),isWooProductEntity:t.getIsWooProductEntity(),hasValidPremiumSubscription:s.selectPremiumSubscription(),hasValidWooSubscription:s.selectWooCommerceSubscription()}},[]),p=(0,l.useMemo)(()=>c&&!a||a&&d&&c,[c,a,d]),[m,,h,,g]=(0,R.useToggleState)(r===o),y=Math.max(0,o-r);(0,l.useEffect)(()=>{h(p&&r===o||!p&&y<=5)},[r,o,p,t]);const x=(0,l.useMemo)(()=>a?n:i,[a,n,i]),w=(0,l.useMemo)(()=>a&&!d,[a,d]);return m&&(0,u.jsx)(R.Notifications.Notification,{id:"ai-sparks-limit",className:e,variant:"info",dismissScreenReaderLabel:(0,s.__)("Close","wordpress-seo"),title:p?(0,s.sprintf)(/* translators: %s is the number of the sparks. */ /* translators: %s is the number of the sparks. */
329 -(0,s._n)("You've used %s spark this month.","You've used %s sparks this month.",r,"wordpress-seo"),r):y<=5&&!t?(0,s.sprintf)(/* translators: %s is the number of the sparks. */ /* translators: %s is the number of the sparks. */
330 -(0,s._n)("%s free spark left!","%s free sparks left!",y,"wordpress-seo"),y):(0,s.__)("You're out of free sparks!","wordpress-seo"),size:p?"default":"large",children:p?(0,u.jsx)(xr,{onClose:g}):(0,u.jsx)(wr,{onClose:g,upsellLink:x,isWooUpsell:w})})},br=()=>{const{previewType:e}=Es();switch(e){case ns:return lt;case as:return pr;default:return rt}},vr=()=>{const{editType:e}=Es();switch(e){case ls:return(()=>{const{previewType:e}=Es(),{updateData:s,setFacebookPreviewTitle:t,setTwitterPreviewTitle:r}=(0,k.useDispatch)(os);return(0,l.useMemo)(()=>{switch(e){case is:return e=>s({title:e});case ns:return t;case as:return r;default:return i.noop}},[e,s,t,r])})();case cs:return(()=>{const{previewType:e}=Es(),{updateData:s,setFacebookPreviewDescription:t,setTwitterPreviewDescription:r}=(0,k.useDispatch)(os);return(0,l.useMemo)(()=>{switch(e){case is:return e=>s({description:e});case ns:return t;case as:return r;default:return i.noop}},[e,s,t,r])})();default:return i.noop}},kr=(0,Ns.createSlice)({name:"suggestions",initialState:{status:hs.loading,error:{code:200,message:""},entities:[],selected:""},reducers:{setLoading:e=>{e.status=hs.loading},setSuccess:(e,{payload:s})=>{e.status=hs.success,e.selected=s[0],e.entities.push(...s)},setError:(e,{payload:s})=>{e.status=hs.error,e.error=s},setSelected:(e,{payload:s})=>{e.selected=s}}}),_r=e=>{switch(e){case ns:return"Facebook";case as:return"Twitter";default:return"Google"}},jr=()=>{const[e,s]=(0,l.useReducer)(kr.reducer,kr.getInitialState()),{editType:t,previewType:r,postType:o,contentType:n}=Es(),a=(0,k.useSelect)(e=>e(rs).selectPromptContent(),[]),c=(0,k.useSelect)(e=>e(rs).selectGetSuggestionsEndpoint(),[]),{contentLocale:d,focusKeyphrase:u,isWooCommerceActive:p,isGutenberg:m,isElementor:h}=(0,k.useSelect)(e=>({contentLocale:e(os).getContentLocale(),focusKeyphrase:e(os).getFocusKeyphrase(),isWooCommerceActive:e(os).getIsWooCommerceActive(),isGutenberg:e(os).getIsBlockEditor(),isElementor:e(os).getIsElementorEditor()}),[]);let g,y=Le.languageProcessing.helpers.processExactMatchRequest(u).keyphrase;y.length>191&&(y=y.slice(0,191)),g=h?"elementor":m?"gutenberg":"classic";const x=((e,s,t,r)=>{const o=e===cs?"meta-description":"seo-title";let i=((e,s)=>{if(e)switch(s){case"product":return"product-";case"product_cat":case"product_tag":return"product-taxonomy-"}return""})(s,t);return i&&s||r!==us||(i="taxonomy-"),`${i}${o}`})(t,p,o,n);return{suggestions:e,fetchSuggestions:(0,l.useCallback)(async(e=!0)=>{s(kr.actions.setLoading());const{status:t,payload:o}=await(async({endpoint:e,data:s})=>{let t;const r=1e3*(0,i.get)(window,"wpseoAiGenerator.requestTimeout",30);try{vs&&vs.abort(),vs=new AbortController,ks=!1,t=setTimeout(()=>{ks=!0,vs.abort()},r);const o=await C()({path:e,method:"POST",data:s,parse:!1,signal:vs.signal}),i=await o.json();return{status:gs,payload:i}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return ks?{status:ys,payload:{message:"timeout",code:408}}:{status:xs};const{message:s,missingLicenses:t,errorIdentifier:r}=await(async e=>{try{const s=e.body.getReader(),{value:t}=await s.read(),r=new TextDecoder("utf-8").decode(t);return console.error(r),JSON.parse(r)}catch(e){return{message:"Unknown"}}})(e);return{status:ys,payload:{message:s,code:e.status||500,missingLicenses:t,errorIdentifier:r}}}finally{clearTimeout(t)}})({endpoint:c,canAbort:e,data:{type:x,prompt_content:a,focus_keyphrase:y,platform:_r(r),language:bs(d).replace("_","-"),editor:g}});switch(t){case xs:break;case ys:s(kr.actions.setError(o));break;case gs:s(kr.actions.setSuccess(o))}return t},[s]),setSelectedSuggestion:(0,l.useCallback)(e=>s(kr.actions.setSelected(e)),[s])}},Sr=({editType:e,title:s,description:t})=>{const r=(0,k.useSelect)(e=>e(os).getDateFromSettings(),[]),o=(0,k.useSelect)(e=>e(os).getContentLocale(),[]),i=(0,k.useSelect)(e=>e(os).isCornerstoneContent(),[]),n=(0,k.useSelect)(e=>e(os).getIsTerm(),[]);return(0,l.useMemo)(()=>e===cs?(0,tt.getDescriptionProgress)(t,r,i,n,o):(0,tt.getTitleProgress)(s),[e,s,t,r,i,n,o])},Cr=()=>{const{editType:e,previewType:s,contentType:t}=Es(),r=(()=>{const{previewType:e}=Es();return(0,l.useMemo)(()=>{switch(e){case is:return()=>(0,k.select)(os).getSnippetEditorData().title;case ns:return(0,k.select)(os).getFacebookTitleOrFallback;case as:return(0,k.select)(os).getTwitterTitleOrFallback;default:return(0,i.constant)("")}},[e])})(),o=(0,k.useSelect)(t=>t(rs).selectAppliedSuggestionFor({editType:e,previewType:s}),[e,s]);return(0,l.useMemo)(()=>{let s=r();return e===cs?s:(o&&(s=s.replace(o,ms[t])),((e,s)=>e.includes(ms[s])?e:ms[s])(s,t))},[e,r])},Rr=e=>{const{isWooProductEntity:t,isProductPost:r,hasValidWooSubscription:o}=(0,k.useSelect)(e=>{const s=e(os),t=e(rs);return{isWooProductEntity:s.getIsWooProductEntity(),isProductPost:s.getIsProduct(),hasValidWooSubscription:t.selectWooCommerceSubscription()}},[]);return(0,l.useMemo)(()=>{const i={upsellLink:e.premium,upsellLabel:(0,s.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. */ /* translators: %1$s expands to Yoast SEO Premium. */
331 -(0,s.__)("Unlock with %1$s","wordpress-seo"),"Yoast SEO Premium"),newToText:"Yoast SEO Premium",ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2",title:(0,s.__)("Use AI to generate your titles & descriptions!","wordpress-seo")};return t&&(r&&(i.title=(0,s.__)("Generate product titles & descriptions with AI!","wordpress-seo")),o||(i.newToText="Yoast WooCommerce SEO",i.upsellLabel=(0,s.sprintf)(/* translators: %1$s expands to Yoast WooCommerce SEO. */ /* translators: %1$s expands to Yoast WooCommerce SEO. */
332 -(0,s.__)("Unlock with %1$s","wordpress-seo"),"Yoast WooCommerce SEO"),i.upsellLink=e.woo,i.ctbId="5b32250e-e6f0-44ae-ad74-3cefc8e427f9")),i},[t,r,e.premium,e.woo])},Er=()=>{const{premiumUpsellLink:e,wooUpsellLink:s,learnMoreLink:t,imageLink:r,wistiaEmbedPermissionValue:o,wistiaEmbedPermissionStatus:i}=(0,k.useSelect)(e=>{const s=e(os);return{premiumUpsellLink:s.selectLink("https://yoa.st/ai-fix-assessments-upsell"),wooUpsellLink:s.selectLink("https://yoa.st/ai-fix-assessments-upsell-woo-seo"),learnMoreLink:s.selectLink("https://yoa.st/ai-fix-assessments-upsell-learn-more"),imageLink:s.selectImageLink("ai-optimize-preview.jpg"),wistiaEmbedPermissionValue:s.selectWistiaEmbedPermissionValue(),wistiaEmbedPermissionStatus:s.selectWistiaEmbedPermissionStatus()}},[]),n=Rr({premium:e,woo:s}),a=(0,l.useMemo)(()=>({src:r,width:"432",height:"244"}),[r]),{setWistiaEmbedPermission:c}=(0,k.useDispatch)(os),d=(0,l.useMemo)(()=>({value:o,status:i,set:c}),[o,i,c]);return(0,u.jsx)(U,{learnMoreLink:t,thumbnail:a,wistiaEmbedPermission:d,...n})},Lr=e=>{let s=[...e];return e.forEach(e=>{e.innerBlocks&&e.innerBlocks.length>0&&(s=[...s,...Lr(e.innerBlocks)])}),s};i.noop,i.noop,i.noop,window.yoast.externals.redux;const Nr=({id:e,isPremium:t=!1})=>{const r=ts(),o=(0,l.useRef)(),n=e+"AIFixes",[a,,,c,d]=(0,R.useToggleState)(!1),{activeMarker:p,activeAIButtonId:m,editorType:h,isWooSeoUpsellPost:g,keyphrase:y,focusAIButtonId:x}=(0,k.useSelect)(e=>({activeMarker:e("yoast-seo/editor").getActiveMarker(),activeAIButtonId:e("yoast-seo/editor").getActiveAIFixesButton(),focusAIButtonId:e("yoast-seo/editor").getFocusAIFixesButtonId(),editorType:e("yoast-seo/editor").getEditorType(),isWooSeoUpsellPost:e("yoast-seo/editor").getIsWooSeoUpsell(),keyphrase:e("yoast-seo/editor").getFocusKeyphrase()}),[]),w=(()=>{const e=(0,k.useSelect)(e=>e("yoast-seo/editor").getEditorType(),[]);return"blockEditor"===e?(0,k.useSelect)(e=>e("core/edit-post").getEditorMode(),[]):"classicEditor"===e?function(){const e=document.getElementById("wp-content-wrap");return!!e&&e.classList.contains("html-active")}()?"text":"visual":""})(),f=!t||g,{setActiveAIFixesButton:b,setActiveMarker:v,setMarkerPauseStatus:_,setMarkerStatus:j,setFocusAIFixesButtonId:S}=(0,k.useDispatch)("yoast-seo/editor"),C=(0,l.useRef)(null),[E,,,L,N]=(0,R.useToggleState)(!1),M=(0,s.__)("Optimize with AI","wordpress-seo"),I=(0,s.__)("Please switch to the visual editor to optimize with AI.","wordpress-seo"),T=m===n,{isEnabled:P,ariaLabel:A}=(0,k.useSelect)(t=>{if(f){if("blockEditor"===h){const e=Lr(t("core/editor").getEditorBlocks()),s="visual"===w&&e.every(e=>"visual"===t("core/block-editor").getBlockMode(e.clientId));return{isEnabled:s,ariaLabel:s?M:I}}return{isEnabled:"visual"===w,ariaLabel:"visual"===w?M:I}}if("visual"!==w)return{isEnabled:!1,ariaLabel:I};if("blockEditor"===h&&!Lr(t("core/editor").getEditorBlocks()).every(e=>"visual"===t("core/block-editor").getBlockMode(e.clientId)))return{isEnabled:!1,ariaLabel:I};if(["introductionKeyword","keyphraseDensity","keyphraseDistribution"].includes(e)){const e=!!y&&y.trim().length>0,t=(0,i.get)(window,"YoastSEO.analysis.collectData",!1),r=t?t():{},o=((null==r?void 0:r._text)||"").trim().length>0;if(!e||!o)return{isEnabled:!1,ariaLabel:(0,s.__)("Please add both a keyphrase and some text to your content.","wordpress-seo")}}const r=t("yoast-seo/editor").getDisabledAIFixesButtons();if(Object.keys(r).includes(n))return{isEnabled:!1,ariaLabel:r[n]};const o=t("yoast-seo/editor").getActiveAIFixesButton();return o&&o!==n?{isEnabled:!1,ariaLabel:(0,s.__)("Please apply or discard the current AI suggestion.","wordpress-seo")}:{isEnabled:!0,ariaLabel:M}},[T,m,w,e,y]),O=()=>{p&&(v(null),_(!1),window.YoastSEO.analysis.applyMarks(new Le.Paper("",{}),[])),S(`${n}-${r}`),n===m?(b(null),j("enabled")):(b(n),j("disabled")),N()},B=(0,l.useCallback)(()=>{f?c():(O(),(0,$e.doAction)("yoast.ai.fixAssessments",n))},[f,n,O,c]),F=(0,l.useCallback)(()=>{S(null)},[S]);return(0,l.useLayoutEffect)(()=>{o.current&&x===`${n}-${r}`&&n!==m&&o.current.focus()},[x,m,n,r]),(0,u.jsxs)(R.Root,{children:[(0,u.jsxs)("div",{className:"yst-relative yst-inline-flex",children:[(0,u.jsx)(R.Button,{onClick:B,id:`${n}-${r}`,"data-id":n,disabled:!P,ref:o,onBlur:F,onPointerEnter:L,onPointerLeave:N,variant:T?"ai-primary":"ai-secondary",size:"small","aria-label":A,className:"yst-px-2",children:f&&(0,u.jsx)(qe(),{className:"yst-fixes-button__lock-icon yst-text-amber-900"})}),E&&!T&&(0,u.jsx)(R.Tooltip,{position:P?"left":"top-left",className:"yst-max-w-[13.5rem] yst-text-center yst-py-1.5",children:A})]}),(0,u.jsx)(R.Modal,{className:"yst-introduction-modal",isOpen:a,onClose:d,initialFocus:C,children:(0,u.jsx)(R.Modal.Panel,{className:"yst-max-w-lg yst-p-0 yst-rounded-3xl yst-introduction-modal-panel",children:(0,u.jsx)(Er,{onClose:d,focusElementRef:C})})})]})};Nr.propTypes={id:a().string.isRequired,isPremium:a().bool};const Mr=Nr,Ir=(e,s,t)=>{const r=document.body.classList.contains("elementor-editor-active");return e&&!s&&!r&&!t},Tr=(0,j.getQueryArg)(window.location.href,"yoast-tab"),Pr=d().span`
414 +`;class Vo extends Q.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:s,imageFallbackUrl:t,alt:o,title:r,description:i,siteUrl:n}=this.props,a=e?Go:Yo;return(0,u.jsxs)(a,{id:"twitterPreview",children:[(0,u.jsx)(qo,{src:s||t,alt:o,isLarge:e,onImageClick:this.props.onImageClick,onMouseEnter:this.onImageEnter,onMouseLeave:this.onLeave}),(0,u.jsxs)(Ho,{children:[(0,u.jsx)(Po,{siteUrl:n}),(0,u.jsx)(zo,{onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle,children:r}),(0,u.jsx)(Do,{onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription,children:i})]})]})}}Vo.propTypes={siteUrl:a().string.isRequired,title:a().string.isRequired,description:a().string,isLarge:a().bool,imageUrl:a().string,imageFallbackUrl:a().string,alt:a().string,onSelect:a().func,onImageClick:a().func,onMouseHover:a().func},Vo.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{},isLarge:!0};const Zo=Vo,Qo=window.yoast.replacementVariableEditor;class Xo extends Q.Component{constructor(e){super(e),this.state={activeField:"",hoveredField:""},this.SocialPreview="Social"===e.socialMediumName?Mo:Zo,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,s){switch(e){case"title":this.titleEditorRef=s;break;case"description":this.descriptionEditorRef=s}}render(){const{onDescriptionChange:e,onTitleChange:s,onSelectImageClick:t,onRemoveImageClick:r,socialMediumName:i,imageWarnings:n,siteUrl:a,description:l,descriptionInputPlaceholder:c,descriptionPreviewFallback:d,imageUrl:p,imageFallbackUrl:h,alt:m,title:g,titleInputPlaceholder:y,titlePreviewFallback:x,replacementVariables:w,recommendedReplacementVariables:f,applyReplacementVariables:b,onReplacementVariableSearchChange:v,isPremium:k,isLarge:j,socialPreviewLabel:_,idSuffix:S,activeMetaTabId:C}=this.props,R=b({title:g||x,description:l||d});return(0,u.jsxs)(X().Fragment,{children:[_&&(0,u.jsx)(o.SimulatedLabel,{children:_}),(0,u.jsx)(this.SocialPreview,{onMouseHover:this.setHoveredField,onSelect:this.setActiveField,onImageClick:t,siteUrl:a,title:R.title,description:R.description,imageUrl:p,imageFallbackUrl:h,alt:m,isLarge:j,activeMetaTabId:C}),(0,u.jsx)(ho.SocialMetadataPreviewForm,{onDescriptionChange:e,socialMediumName:i,title:g,titleInputPlaceholder:y,onRemoveImageClick:r,imageSelected:!!p,imageUrl:p,imageFallbackUrl:h,onTitleChange:s,onSelectImageClick:t,description:l,descriptionInputPlaceholder:c,imageWarnings:n,replacementVariables:w,recommendedReplacementVariables:f,onReplacementVariableSearchChange:v,onMouseHover:this.setHoveredField,hoveredField:this.state.hoveredField,onSelect:this.setActiveField,activeField:this.state.activeField,isPremium:k,setEditorRef:this.setEditorRef,idSuffix:S})]})}}Xo.propTypes={title:a().string.isRequired,onTitleChange:a().func.isRequired,description:a().string.isRequired,onDescriptionChange:a().func.isRequired,imageUrl:a().string.isRequired,imageFallbackUrl:a().string.isRequired,onSelectImageClick:a().func.isRequired,onRemoveImageClick:a().func.isRequired,socialMediumName:a().string.isRequired,alt:a().string,isPremium:a().bool,imageWarnings:a().array,isLarge:a().bool,siteUrl:a().string,descriptionInputPlaceholder:a().string,titleInputPlaceholder:a().string,descriptionPreviewFallback:a().string,titlePreviewFallback:a().string,replacementVariables:Qo.replacementVariablesShape,recommendedReplacementVariables:Qo.recommendedReplacementVariablesShape,applyReplacementVariables:a().func,onReplacementVariableSearchChange:a().func,socialPreviewLabel:a().string,idSuffix:a().string,activeMetaTabId:a().string},Xo.defaultProps={imageWarnings:[],recommendedReplacementVariables:[],replacementVariables:[],isPremium:!1,isLarge:!0,siteUrl:"",descriptionInputPlaceholder:"",titleInputPlaceholder:"",descriptionPreviewFallback:"",titlePreviewFallback:"",alt:"",applyReplacementVariables:e=>e,onReplacementVariableSearchChange:null,socialPreviewLabel:"",idSuffix:"",activeMetaTabId:""};const Jo={},er=(e,s,{log:t=console.warn}={})=>{Jo[e]||(Jo[e]=!0,t(s))},sr=(e,s=i.noop)=>{const t={};for(const o in e)Object.hasOwn(e,o)&&Object.defineProperty(t,o,{set:t=>{e[o]=t,s("set",o,t)},get:()=>(s("get",o),e[o])});return t};sr({squareWidth:125,squareHeight:125,landscapeWidth:506,landscapeHeight:265,aspectRatio:50.2},(e,s)=>er(`@yoast/social-metadata-previews/TWITTER_IMAGE_SIZES/${e}/${s}`,`[@yoast/social-metadata-previews] "TWITTER_IMAGE_SIZES.${s}" is deprecated and will be removed in the future, please use this from @yoast/social-metadata-forms instead.`)),sr({squareWidth:158,squareHeight:158,landscapeWidth:527,landscapeHeight:273,portraitWidth:158,portraitHeight:237,aspectRatio:52.2,largeThreshold:{width:446,height:233}},(e,s)=>er(`@yoast/social-metadata-previews/FACEBOOK_IMAGE_SIZES/${e}/${s}`,`[@yoast/social-metadata-previews] "FACEBOOK_IMAGE_SIZES.${s}" is deprecated and will be removed in the future, please use this from @yoast/social-metadata-forms instead.`));const tr=({title:e,description:s})=>{const t=(0,C.useSelect)(e=>e(Ee).getSiteUrl(),[]),o=(0,C.useSelect)(e=>e(Ee).getFacebookImageUrl(),[]),r=(0,C.useSelect)(e=>e(Ee).getEditorDataImageFallback(),[]),n=(0,C.useSelect)(e=>e(Ee).getFacebookAltText(),[]);return(0,u.jsx)("div",{className:"yst-ai-generator-preview-section",children:(0,u.jsx)(Mo,{title:e,description:s,siteUrl:t,imageUrl:o,imageFallbackUrl:r,alt:n,onSelect:i.noop,onImageClick:i.noop,onMouseHover:i.noop})})};tr.propTypes={title:a().string.isRequired,description:a().string.isRequired};const or=()=>(0,u.jsxs)("div",{className:"yst-flex yst-flex-col yst-w-[527px] yst-border yst-mx-auto",children:[(0,u.jsx)(I.SkeletonLoader,{className:"yst-h-[273px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,u.jsxs)("div",{className:"yst-w-full yst-p-4 yst-space-y-1",children:[(0,u.jsx)(I.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,u.jsx)(I.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,u.jsx)(I.SkeletonLoader,{className:"yst-h-3 yst-w-full"})]})]}),rr=()=>(0,u.jsxs)(I.Alert,{variant:"error",children:[(0,u.jsx)("span",{className:"yst-block yst-font-medium",children:Ns}),(0,u.jsx)(Is,{})]}),ir=({children:e,onRetry:t})=>{const{onClose:o}=(0,I.useModalContext)();return(0,u.jsxs)(l.Fragment,{children:[e,(0,u.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,u.jsx)(I.Button,{variant:"secondary",onClick:o,children:(0,s.__)("Close","wordpress-seo")}),(0,u.jsx)(I.Button,{variant:"primary",onClick:t,children:(0,s.__)("Try again","wordpress-seo")})]})]})};ir.propTypes={children:a().node.isRequired,onRetry:a().func.isRequired};const nr=({errorCode:e,errorIdentifier:s,invalidSubscriptions:t=[],showActions:o=!1,onRetry:r=i.noop,errorMessage:n=""})=>{switch(e){case 400:switch(s){case"AI_CONTENT_FILTER":return(0,u.jsx)(cs,{});case"NOT_ENOUGH_CONTENT":return(0,u.jsx)(Ve,{});case"SITE_UNREACHABLE":return(0,u.jsx)(rr,{});case"WP_HTTP_REQUEST_ERROR":return o?(0,u.jsx)(ir,{onRetry:r,children:(0,u.jsx)(ps,{errorMessage:n})}):(0,u.jsx)(ps,{errorMessage:n});default:return o?(0,u.jsx)(ir,{onRetry:r,children:(0,u.jsx)(Ke,{})}):(0,u.jsx)(Ke,{})}case 402:return(0,u.jsx)(os,{invalidSubscriptions:t});case 408:return o?(0,u.jsx)(ir,{onRetry:r,children:(0,u.jsx)(ns,{})}):(0,u.jsx)(ns,{});case 429:return"USAGE_LIMIT_REACHED"===s?(0,u.jsx)(os,{invalidSubscriptions:t}):(0,u.jsx)(es,{});case 410:return(0,u.jsx)(gs,{});default:return o?(0,u.jsx)(ir,{onRetry:r,children:(0,u.jsx)(Ke,{})}):(0,u.jsx)(Ke,{})}};nr.propTypes={errorCode:a().number.isRequired,errorIdentifier:a().string.isRequired,invalidSubscriptions:a().array,showActions:a().bool,onRetry:a().func,errorMessage:a().string};const ar=a().shape({value:a().string.isRequired,label:a().node.isRequired}),lr=({id:e,name:s,suggestion:t,isChecked:o,onChange:r})=>{const i=(0,l.useCallback)(()=>r(t.value),[t,r]);return(0,u.jsxs)("label",{htmlFor:e,className:he()("yst-flex yst-p-4 yst-items-center yst-border first:yst-rounded-t-md last:yst-rounded-b-md",o&&"yst-z-10 yst-border-primary-500"),children:[(0,u.jsx)("input",{type:"radio",id:e,name:s,className:"yst-radio__input",value:t.value,checked:o,onChange:i}),(0,u.jsx)("div",{className:he()("yst-label yst-radio__label yst-flex yst-flex-wrap yst-items-center",!o&&"yst-text-slate-600"),children:t.label})]})};lr.propTypes={id:a().string.isRequired,name:a().string.isRequired,suggestion:ar.isRequired,isChecked:a().bool.isRequired,onChange:a().func.isRequired};const cr=({idSuffix:e,suggestions:s,selected:t,onChange:o})=>(0,u.jsx)("div",{children:(0,u.jsx)(I.RadioGroup,{className:"yst-suggestions-radio-group yst-flex yst-flex-col",id:`yst-ai-suggestions-radio-group__${e}`,children:s.map((s,r)=>(0,u.jsx)(lr,{id:`yst-ai-suggestions-radio-${e}__${r}`,name:`ai-suggestion__${e}`,isChecked:s.value===t,onChange:o,suggestion:s},`yst-ai-suggestions-radio-${e}__${r}`))})});cr.propTypes={idSuffix:a().string.isRequired,suggestions:a().arrayOf(ar).isRequired,selected:a().string.isRequired,onChange:a().func.isRequired};const dr=[["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"]],ur=({suggestionClassNames:e=dr})=>(0,u.jsx)("div",{className:"yst-flex yst-flex-col yst--space-y-[1px]",children:e.map((e,s)=>(0,u.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,u.jsx)("input",{type:"radio",disabled:!0,className:"yst-my-0.5"}),(0,u.jsx)("div",{className:"yst-flex yst-flex-col yst-w-full",children:e.map((e,t)=>(0,u.jsx)(I.SkeletonLoader,{className:e},`yst-ai-suggestion-radio-skeleton-${s}__${t}`))})]},`yst-ai-suggestion-radio-skeleton__${s}`))});ur.propTypes={suggestionClassNames:a().arrayOf(a().arrayOf(a().string))};const pr="ai_generator_tip_notification",hr=()=>{const e=(0,C.useSelect)(e=>e(Ee).isAlertDismissed(pr),[]),t=(0,C.useSelect)(e=>e(Ee).getEditorDataContent(),[]),o=(0,C.useSelect)(e=>e(Ee).getIsWooProductEntity(),[]),[r,,,i]=(0,I.useToggleState)(!1),{editType:n,contentType:a}=It(),{dismissAlert:c}=(0,C.useDispatch)(Ee),d=(0,l.useCallback)(()=>{c(pr)},[c]),p=(0,l.useMemo)(()=>n===Te?(0,s.__)("%1$sTip%2$s: Improve the accuracy of your generated AI descriptions by writing more content in your page.","wordpress-seo"):(0,s.__)("%1$sTip%2$s: Improve the accuracy of your generated AI titles by writing more content in your page.","wordpress-seo")
415 +/* translators: %1$s and %2$s expand to opening and closing of a span in order to emphasise the word. */,[n]),h=(0,l.useMemo)(()=>((e,s)=>e||s===Pe?150:300)(o,a),[a,o]),m=(0,l.useMemo)(()=>(e=>Ks.languageProcessing.sanitizeString(e||"").length)(t),[t]);return e||r||m>h?null:(0,u.jsxs)(I.Notifications.Notification,{id:"ai-generator-content-tip",variant:"info",dismissScreenReaderLabel:(0,s.__)("Dismiss","wordpress-seo"),children:[q((0,s.sprintf)(p,"<span>","</span>"),{span:(0,u.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})}),(0,u.jsxs)("div",{className:"yst-flex yst-mt-3 yst--ms-3 yst-gap-1",children:[(0,u.jsx)(I.Button,{type:"button",variant:"tertiary",onClick:d,children:(0,s.__)("Don’t show again","wordpress-seo")}),(0,u.jsx)(I.Button,{type:"button",variant:"tertiary",className:"yst-text-slate-800",onClick:i,children:(0,s.__)("Dismiss","wordpress-seo")})]})]})},mr=({title:e,description:t,showPreviewSkeleton:o})=>(0,u.jsxs)("div",{children:[(0,u.jsx)("div",{className:"yst-flex yst-mb-6",children:(0,u.jsx)(I.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:(0,s.__)("X preview","wordpress-seo")})}),o?(0,u.jsx)(yr,{}):(0,u.jsx)(gr,{title:e,description:t})]});mr.propTypes={title:a().string.isRequired,description:a().string.isRequired,showPreviewSkeleton:a().bool.isRequired};const gr=({title:e,description:s})=>{const t=(0,C.useSelect)(e=>e(Ee).getSiteUrl(),[]),o=(0,C.useSelect)(e=>e(Ee).getTwitterImageUrl(),[]),r=(0,C.useSelect)(e=>e(Ee).getFacebookImageUrl(),[]),n=(0,C.useSelect)(e=>e(Ee).getEditorDataImageFallback(),[]),a=(0,C.useSelect)(e=>e(Ee).getTwitterImageType(),[]),l=(0,C.useSelect)(e=>e(Ee).getTwitterAltText(),[]);return(0,u.jsx)("div",{className:"yst-ai-generator-preview-section",children:(0,u.jsx)(Zo,{title:e,description:s,siteUrl:t,imageUrl:o,imageFallbackUrl:r||n,isLarge:"summary"!==a,alt:l,onSelect:i.noop,onImageClick:i.noop,onMouseHover:i.noop})})};gr.propTypes={title:a().string.isRequired,description:a().string.isRequired};const yr=()=>(0,u.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,u.jsx)(I.SkeletonLoader,{className:"yst-h-[265px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,u.jsxs)("div",{className:"yst-w-full yst-p-4 yst-space-y-1",children:[(0,u.jsx)(I.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,u.jsx)(I.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,u.jsx)(I.SkeletonLoader,{className:"yst-h-3 yst-w-full"})]})]}),xr="yst-mt-1 yst-mb-3",wr="yst-flex yst-justify-end yst--me-8 yst-gap-3 yst--ms-2",fr=({onClose:e})=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("p",{className:xr,children:(0,s.__)("As long as this is a beta feature, you get unlimited sparks.","wordpress-seo")}),(0,u.jsx)("div",{className:wr,children:(0,u.jsx)(I.Button,{type:"button",variant:"primary",size:"small",onClick:e,children:(0,s.__)("Got it!","wordpress-seo")})})]}),br=({onClose:e,upsellLink:t,isWooProductEntity:o=!1,ctbId:r="f6a84663-465f-4cb5-8ba5-f7a6d72224b2"})=>{const i=(0,I.useSvgAria)();return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("p",{className:xr,children:(0,s.sprintf)(/* translators: %s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ /* translators: %s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */
416 +(0,s.__)("Keep the momentum going, unlock unlimited sparks with %s!","wordpress-seo"),o?"Yoast WooCommerce SEO":"Yoast SEO Premium")}),(0,u.jsxs)("div",{className:wr,children:[(0,u.jsx)(I.Button,{type:"button",variant:"tertiary",size:"small",onClick:e,children:(0,s.__)("Close","wordpress-seo")}),(0,u.jsxs)(I.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,u.jsx)(z(),{className:"yst-w-4 yst-h-4 yst--ms-1 yst-me-2 yst-shrink-0",...i}),(0,s.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. */
417 +(0,s.__)("Unlock with %1$s","wordpress-seo"),o?"Yoast WooCommerce SEO":"Yoast SEO Premium"),(0,u.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
418 +(0,s.__)("(Opens in a new browser tab)","wordpress-seo")})]})]})]})},vr=({className:e=""})=>{const{isUsageCountLimitReached:t,usageCount:o,usageCountLimit:r,premiumUpsellLink:i,wooUpsellLink:n,isWooProductEntity:a,hasValidPremiumSubscription:c,hasValidWooSubscription:d}=(0,C.useSelect)(e=>{const s=e(Re),t=e(Ee);return{isUsageCountLimitReached:s.isUsageCountLimitReached(),usageCount:s.selectUsageCount(),usageCountLimit:s.selectUsageCountLimit(),premiumUpsellLink:t.selectLink("https://yoa.st/ai-toast-out-of-free-sparks"),wooUpsellLink:t.selectLink("https://yoa.st/ai-toast-out-of-free-sparks-woo"),isWooProductEntity:t.getIsWooProductEntity(),hasValidPremiumSubscription:s.selectPremiumSubscription(),hasValidWooSubscription:s.selectWooCommerceSubscription()}},[]),p=(0,l.useMemo)(()=>c&&!a||a&&d&&c,[c,a,d]),[h,,m,,g]=(0,I.useToggleState)(o===r),y=Math.max(0,r-o);(0,l.useEffect)(()=>{m(p&&o===r||!p&&y<=5)},[o,r,p,t]);const x=(0,l.useMemo)(()=>a?n:i,[a,n,i]),w=(0,l.useMemo)(()=>a&&!d,[a,d]);return h&&(0,u.jsx)(I.Notifications.Notification,{id:"ai-sparks-limit",className:e,variant:"info",dismissScreenReaderLabel:(0,s.__)("Close","wordpress-seo"),title:p?(0,s.sprintf)(/* translators: %s is the number of the sparks. */ /* translators: %s is the number of the sparks. */
419 +(0,s._n)("You've used %s spark this month.","You've used %s sparks this month.",o,"wordpress-seo"),o):y<=5&&!t?(0,s.sprintf)(/* translators: %s is the number of the sparks. */ /* translators: %s is the number of the sparks. */
420 +(0,s._n)("%s free spark left!","%s free sparks left!",y,"wordpress-seo"),y):(0,s.__)("You're out of free sparks!","wordpress-seo"),size:p?"default":"large",children:p?(0,u.jsx)(fr,{onClose:g}):(0,u.jsx)(br,{onClose:g,upsellLink:x,isWooUpsell:w})})};a().number.isRequired,a().string,a().string,a().object.isRequired,a().bool;const kr=()=>{const{previewType:e}=It();switch(e){case Ne:return lo;case Ie:return mr;default:return oo}},jr=()=>{const{editType:e}=It();switch(e){case Me:return(()=>{const{previewType:e}=It(),{updateData:s,setFacebookPreviewTitle:t,setTwitterPreviewTitle:o}=(0,C.useDispatch)(Ee);return(0,l.useMemo)(()=>{switch(e){case Le:return e=>s({title:e});case Ne:return t;case Ie:return o;default:return i.noop}},[e,s,t,o])})();case Te:return(()=>{const{previewType:e}=It(),{updateData:s,setFacebookPreviewDescription:t,setTwitterPreviewDescription:o}=(0,C.useDispatch)(Ee);return(0,l.useMemo)(()=>{switch(e){case Le:return e=>s({description:e});case Ne:return t;case Ie:return o;default:return i.noop}},[e,s,t,o])})();default:return i.noop}},_r=(0,Bt.createSlice)({name:"suggestions",initialState:{status:Fe.loading,error:{code:200,message:""},entities:[],selected:""},reducers:{setLoading:e=>{e.status=Fe.loading},setSuccess:(e,{payload:s})=>{e.status=Fe.success,e.selected=s[0],e.entities.push(...s)},setError:(e,{payload:s})=>{e.status=Fe.error,e.error=s},setSelected:(e,{payload:s})=>{e.selected=s}}}),Sr=e=>{switch(e){case Ne:return"Facebook";case Ie:return"Twitter";default:return"Google"}},Cr=()=>{const[e,s]=(0,l.useReducer)(_r.reducer,_r.getInitialState()),{editType:t,previewType:o,postType:r,contentType:n}=It(),a=(0,C.useSelect)(e=>e(Re).selectPromptContent(),[]),c=(0,C.useSelect)(e=>e(Re).selectGetSuggestionsEndpoint(),[]),{contentLocale:d,focusKeyphrase:u,isWooCommerceActive:p,isGutenberg:h,isElementor:m}=(0,C.useSelect)(e=>({contentLocale:e(Ee).getContentLocale(),focusKeyphrase:e(Ee).getFocusKeyphrase(),isWooCommerceActive:e(Ee).getIsWooCommerceActive(),isGutenberg:e(Ee).getIsBlockEditor(),isElementor:e(Ee).getIsElementorEditor()}),[]);let g,y=Ks.languageProcessing.helpers.processExactMatchRequest(u).keyphrase;y.length>191&&(y=y.slice(0,191)),g=m?"elementor":h?"gutenberg":"classic";const x=((e,s,t,o)=>{const r=e===Te?"meta-description":"seo-title";let i=((e,s)=>{if(e)switch(s){case"product":return"product-";case"product_cat":case"product_tag":return"product-taxonomy-"}return""})(s,t);return i&&s||o!==Pe||(i="taxonomy-"),`${i}${r}`})(t,p,r,n);return{suggestions:e,fetchSuggestions:(0,l.useCallback)(async(e=!0)=>{s(_r.actions.setLoading());const{status:t,payload:r}=await(async({endpoint:e,data:s})=>{let t;const o=1e3*(0,i.get)(window,"wpseoAiGenerator.requestTimeout",30);try{jt&&jt.abort(),jt=new AbortController,_t=!1,t=setTimeout(()=>{_t=!0,jt.abort()},o);const r=await N()({path:e,method:"POST",data:s,parse:!1,signal:jt.signal}),i=await r.json();return{status:$e,payload:i}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return _t?{status:qe,payload:{message:"timeout",code:408}}:{status:Ue};const{message:s,missingLicenses:t,errorIdentifier:o}=await(async e=>{try{const s=e.body.getReader(),{value:t}=await s.read(),o=new TextDecoder("utf-8").decode(t);return console.error(o),JSON.parse(o)}catch(e){return{message:"Unknown"}}})(e);return{status:qe,payload:{message:s,code:e.status||500,missingLicenses:t,errorIdentifier:o}}}finally{clearTimeout(t)}})({endpoint:c,canAbort:e,data:{type:x,prompt_content:a,focus_keyphrase:y,platform:Sr(o),language:kt(d).replace("_","-"),editor:g}});switch(t){case Ue:break;case qe:s(_r.actions.setError(r));break;case $e:s(_r.actions.setSuccess(r))}return t},[s]),setSelectedSuggestion:(0,l.useCallback)(e=>s(_r.actions.setSelected(e)),[s])}},Rr=({editType:e,title:s,description:t})=>{const o=(0,C.useSelect)(e=>e(Ee).getDateFromSettings(),[]),r=(0,C.useSelect)(e=>e(Ee).getContentLocale(),[]),i=(0,C.useSelect)(e=>e(Ee).isCornerstoneContent(),[]),n=(0,C.useSelect)(e=>e(Ee).getIsTerm(),[]);return(0,l.useMemo)(()=>e===Te?(0,to.getDescriptionProgress)(t,o,i,n,r):(0,to.getTitleProgress)(s),[e,s,t,o,i,n,r])},Er=()=>{const{editType:e,previewType:s,contentType:t}=It(),o=(()=>{const{previewType:e}=It();return(0,l.useMemo)(()=>{switch(e){case Le:return()=>(0,C.select)(Ee).getSnippetEditorData().title;case Ne:return(0,C.select)(Ee).getFacebookTitleOrFallback;case Ie:return(0,C.select)(Ee).getTwitterTitleOrFallback;default:return(0,i.constant)("")}},[e])})(),r=(0,C.useSelect)(t=>t(Re).selectAppliedSuggestionFor({editType:e,previewType:s}),[e,s]);return(0,l.useMemo)(()=>{let s=o();return e===Te?s:(r&&(s=s.replace(r,Be[t])),((e,s)=>e.includes(Be[s])?e:Be[s])(s,t))},[e,o])},Lr=e=>{const{isWooProductEntity:t,isProductPost:o,hasValidWooSubscription:r}=(0,C.useSelect)(e=>{const s=e(Ee),t=e(Re);return{isWooProductEntity:s.getIsWooProductEntity(),isProductPost:s.getIsProduct(),hasValidWooSubscription:t.selectWooCommerceSubscription()}},[]);return(0,l.useMemo)(()=>{const i={upsellLink:e.premium,upsellLabel:(0,s.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. */ /* translators: %1$s expands to Yoast SEO Premium. */
421 +(0,s.__)("Unlock with %1$s","wordpress-seo"),"Yoast SEO Premium"),newToText:"Yoast SEO Premium",ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2",title:(0,s.__)("Use AI to generate your titles & descriptions!","wordpress-seo")};return t&&(o&&(i.title=(0,s.__)("Generate product titles & descriptions with AI!","wordpress-seo")),r||(i.newToText="Yoast WooCommerce SEO",i.upsellLabel=(0,s.sprintf)(/* translators: %1$s expands to Yoast WooCommerce SEO. */ /* translators: %1$s expands to Yoast WooCommerce SEO. */
422 +(0,s.__)("Unlock with %1$s","wordpress-seo"),"Yoast WooCommerce SEO"),i.upsellLink=e.woo,i.ctbId="5b32250e-e6f0-44ae-ad74-3cefc8e427f9")),i},[t,o,e.premium,e.woo])},Nr=()=>{const{premiumUpsellLink:e,wooUpsellLink:s,learnMoreLink:t,imageLink:o,wistiaEmbedPermissionValue:r,wistiaEmbedPermissionStatus:i}=(0,C.useSelect)(e=>{const s=e(Ee);return{premiumUpsellLink:s.selectLink("https://yoa.st/ai-fix-assessments-upsell"),wooUpsellLink:s.selectLink("https://yoa.st/ai-fix-assessments-upsell-woo-seo"),learnMoreLink:s.selectLink("https://yoa.st/ai-fix-assessments-upsell-learn-more"),imageLink:s.selectImageLink("ai-optimize-preview.jpg"),wistiaEmbedPermissionValue:s.selectWistiaEmbedPermissionValue(),wistiaEmbedPermissionStatus:s.selectWistiaEmbedPermissionStatus()}},[]),n=Lr({premium:e,woo:s}),a=(0,l.useMemo)(()=>({src:o,width:"432",height:"244"}),[o]),{setWistiaEmbedPermission:c}=(0,C.useDispatch)(Ee),d=(0,l.useMemo)(()=>({value:r,status:i,set:c}),[r,i,c]);return(0,u.jsx)(G,{learnMoreLink:t,thumbnail:a,wistiaEmbedPermission:d,...n})},Ir=e=>{let s=[...e];return e.forEach(e=>{e.innerBlocks&&e.innerBlocks.length>0&&(s=[...s,...Ir(e.innerBlocks)])}),s};i.noop,i.noop,i.noop,window.yoast.externals.redux;const Mr=({id:e,isPremium:t=!1})=>{const o=ft(),r=(0,l.useRef)(),n=e+"AIFixes",[a,,,c,d]=(0,I.useToggleState)(!1),{activeMarker:p,activeAIButtonId:h,editorType:m,isWooSeoUpsellPost:g,keyphrase:y,focusAIButtonId:x}=(0,C.useSelect)(e=>({activeMarker:e("yoast-seo/editor").getActiveMarker(),activeAIButtonId:e("yoast-seo/editor").getActiveAIFixesButton(),focusAIButtonId:e("yoast-seo/editor").getFocusAIFixesButtonId(),editorType:e("yoast-seo/editor").getEditorType(),isWooSeoUpsellPost:e("yoast-seo/editor").getIsWooSeoUpsell(),keyphrase:e("yoast-seo/editor").getFocusKeyphrase()}),[]),w=(()=>{const e=(0,C.useSelect)(e=>e("yoast-seo/editor").getEditorType(),[]);return"blockEditor"===e?(0,C.useSelect)(e=>e("core/edit-post").getEditorMode(),[]):"classicEditor"===e?function(){const e=document.getElementById("wp-content-wrap");return!!e&&e.classList.contains("html-active")}()?"text":"visual":""})(),f=!t||g,{setActiveAIFixesButton:b,setActiveMarker:v,setMarkerPauseStatus:k,setMarkerStatus:j,setFocusAIFixesButtonId:_}=(0,C.useDispatch)("yoast-seo/editor"),S=(0,l.useRef)(null),[R,,,E,L]=(0,I.useToggleState)(!1),N=(0,s.__)("Optimize with AI","wordpress-seo"),M=(0,s.__)("Please switch to the visual editor to optimize with AI.","wordpress-seo"),T=h===n,{isEnabled:A,ariaLabel:P}=(0,C.useSelect)(t=>{if(f){if("blockEditor"===m){const e=Ir(t("core/editor").getEditorBlocks()),s="visual"===w&&e.every(e=>"visual"===t("core/block-editor").getBlockMode(e.clientId));return{isEnabled:s,ariaLabel:s?N:M}}return{isEnabled:"visual"===w,ariaLabel:"visual"===w?N:M}}if("visual"!==w)return{isEnabled:!1,ariaLabel:M};if("blockEditor"===m&&!Ir(t("core/editor").getEditorBlocks()).every(e=>"visual"===t("core/block-editor").getBlockMode(e.clientId)))return{isEnabled:!1,ariaLabel:M};if(["introductionKeyword","keyphraseDensity","keyphraseDistribution"].includes(e)){const e=!!y&&y.trim().length>0,t=(0,i.get)(window,"YoastSEO.analysis.collectData",!1),o=t?t():{},r=((null==o?void 0:o._text)||"").trim().length>0;if(!e||!r)return{isEnabled:!1,ariaLabel:(0,s.__)("Please add both a keyphrase and some text to your content.","wordpress-seo")}}const o=t("yoast-seo/editor").getDisabledAIFixesButtons();if(Object.keys(o).includes(n))return{isEnabled:!1,ariaLabel:o[n]};const r=t("yoast-seo/editor").getActiveAIFixesButton();return r&&r!==n?{isEnabled:!1,ariaLabel:(0,s.__)("Please apply or discard the current AI suggestion.","wordpress-seo")}:{isEnabled:!0,ariaLabel:N}},[T,h,w,e,y]),O=()=>{p&&(v(null),k(!1),window.YoastSEO.analysis.applyMarks(new Ks.Paper("",{}),[])),_(`${n}-${o}`),n===h?(b(null),j("enabled")):(b(n),j("disabled")),L()},B=(0,l.useCallback)(()=>{f?c():(O(),(0,ot.doAction)("yoast.ai.fixAssessments",n))},[f,n,O,c]),F=(0,l.useCallback)(()=>{_(null)},[_]);return(0,l.useLayoutEffect)(()=>{r.current&&x===`${n}-${o}`&&n!==h&&r.current.focus()},[x,h,n,o]),(0,u.jsxs)(I.Root,{children:[(0,u.jsxs)("div",{className:"yst-relative yst-inline-flex",children:[(0,u.jsx)(I.Button,{onClick:B,id:`${n}-${o}`,"data-id":n,disabled:!A,ref:r,onBlur:F,onPointerEnter:E,onPointerLeave:L,variant:T?"ai-primary":"ai-secondary",size:"small","aria-label":P,className:"yst-px-2",children:f&&(0,u.jsx)(tt(),{className:"yst-fixes-button__lock-icon yst-text-amber-900"})}),R&&!T&&(0,u.jsx)(I.Tooltip,{position:A?"left":"top-left",className:"yst-max-w-[13.5rem] yst-text-center yst-py-1.5",children:P})]}),(0,u.jsx)(I.Modal,{className:"yst-introduction-modal",isOpen:a,onClose:d,initialFocus:S,children:(0,u.jsx)(I.Modal.Panel,{className:"yst-max-w-lg yst-p-0 yst-rounded-3xl yst-introduction-modal-panel",children:(0,u.jsx)(Nr,{onClose:d,focusElementRef:S})})})]})};Mr.propTypes={id:a().string.isRequired,isPremium:a().bool};const Tr=Mr,Ar=(e,s,t)=>{const o=document.body.classList.contains("elementor-editor-active");return e&&!s&&!o&&!t},Pr=(0,E.getQueryArg)(window.location.href,"yoast-tab"),Or=d().span`
333 423 font-size: 1em;
334 424 font-weight: bold;
335 425 margin: 0 0 8px;
336 426 display: block;
337 -`,Ar=d().div`
427 +`,Br=d().div`
338 428 padding: 16px;
339 -`,Or=d()(Xe)`
429 +`,Fr=d()(yt)`
340 430 margin: -8px 0 -4px 4px;
341 -`;class Br extends l.Component{constructor(...e){super(...e),Re(this,"renderAIOptimizeButton",(e,s)=>{const{isElementor:t,isAiFeatureEnabled:r,isTerm:o}=this.props,i=ss().isPremium;if(!i||r)return Ir(e,t,o)&&(0,u.jsx)(Mr,{id:s,isPremium:i})})}renderResults(e,t){return(0,u.jsxs)(l.Fragment,{children:[(0,u.jsxs)(Pr,{children:[(0,s.__)("Analysis results","wordpress-seo"),(0,u.jsx)(Or,{href:wpseoAdminL10n["shortlinks.readability_analysis_info"],className:"dashicons",children:(0,u.jsx)("span",{className:"screen-reader-text",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
342 -(0,s.__)("Learn more about the readability analysis","wordpress-seo")})})]}),(0,u.jsx)(Qe,{results:this.props.results,upsellResults:e,marksButtonClassName:"yoast-tooltip yoast-tooltip-w",marksButtonStatus:this.props.marksButtonStatus,location:t,id:t?`yoast-readability-analysis-results-${t}`:"",highlightingUpsellLink:"shortlinks.upsell.sidebar.highlighting_readability_analysis",shouldUpsellHighlighting:this.props.shouldUpsellHighlighting,renderAIOptimizeButton:this.renderAIOptimizeButton})]})}getUpsellResults(e,t){let r=wpseoAdminL10n["shortlinks.upsell.metabox.word_complexity"];return"sidebar"===e&&(r=wpseoAdminL10n["shortlinks.upsell.sidebar.word_complexity"]),r=(0,j.addQueryArgs)(r,{context:t}),function(){const e=Le.helpers.getLanguagesWithWordComplexity(),s=window.wpseoScriptData.metabox.contentLocale,t=Le.languageProcessing.getLanguage(s);return e.includes(t)}()?[{score:0,rating:"upsell",hasMarks:!1,id:"wordComplexity",text:(0,s.sprintf)(
431 +`;class $r extends l.Component{constructor(...e){super(...e),Ds(this,"renderAIOptimizeButton",(e,s)=>{const{isElementor:t,isAiFeatureEnabled:o,isTerm:r}=this.props,i=wt().isPremium;if(!i||o)return Ar(e,t,r)&&(0,u.jsx)(Tr,{id:s,isPremium:i})})}renderResults(e,t){return(0,u.jsxs)(l.Fragment,{children:[(0,u.jsxs)(Or,{children:[(0,s.__)("Analysis results","wordpress-seo"),(0,u.jsx)(Fr,{href:wpseoAdminL10n["shortlinks.readability_analysis_info"],className:"dashicons",children:(0,u.jsx)("span",{className:"screen-reader-text",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
432 +(0,s.__)("Learn more about the readability analysis","wordpress-seo")})})]}),(0,u.jsx)(mt,{results:this.props.results,upsellResults:e,marksButtonClassName:"yoast-tooltip yoast-tooltip-w",marksButtonStatus:this.props.marksButtonStatus,location:t,id:t?`yoast-readability-analysis-results-${t}`:"",highlightingUpsellLink:"shortlinks.upsell.sidebar.highlighting_readability_analysis",shouldUpsellHighlighting:this.props.shouldUpsellHighlighting,renderAIOptimizeButton:this.renderAIOptimizeButton})]})}getUpsellResults(e,t){let o=wpseoAdminL10n["shortlinks.upsell.metabox.word_complexity"];return"sidebar"===e&&(o=wpseoAdminL10n["shortlinks.upsell.sidebar.word_complexity"]),o=(0,E.addQueryArgs)(o,{context:t}),function(){const e=Ks.helpers.getLanguagesWithWordComplexity(),s=window.wpseoScriptData.metabox.contentLocale,t=Ks.languageProcessing.getLanguage(s);return e.includes(t)}()?[{score:0,rating:"upsell",hasMarks:!1,id:"wordComplexity",text:(0,s.sprintf)(
343 433 /* Translators: %1$s is a span tag that adds styling to 'Word complexity', %2$s is a closing span tag.
344 434 %3$s is an anchor tag with a link to yoast.com, %4$s is a closing anchor tag.*/
345 435 /* Translators: %1$s is a span tag that adds styling to 'Word complexity', %2$s is a closing span tag.
346 436 %3$s is an anchor tag with a link to yoast.com, %4$s is a closing anchor tag.*/
347 -(0,s.__)("%1$sWord complexity%2$s: Is your vocabulary suited for a larger audience? %3$sYoast SEO Premium will tell you!%4$s","wordpress-seo"),"<span style='text-decoration: underline'>","</span>",`<a href="${r}" data-action="load-nfd-ctb" data-ctb-id="f6a84663-465f-4cb5-8ba5-f7a6d72224b2" target="_blank">`,"</a>"),markerId:"wordComplexity"}]:[]}render(){const e=Je(this.props.overallScore);return(0,i.isNil)(this.props.overallScore)&&(e.className="loading"),(0,u.jsx)(_.LocationConsumer,{children:t=>(0,u.jsx)(_.RootContext.Consumer,{children:({locationContext:r})=>{let o=[];if(this.props.shouldUpsell&&(o=this.getUpsellResults(t,r)),"sidebar"===t){const r="readability"===Tr;return(0,u.jsx)(w,{title:(0,s.__)("Readability analysis","wordpress-seo"),titleScreenReaderText:e.screenReaderReadabilityText,prefixIcon:Ie(e.className),prefixIconCollapsed:Ie(e.className),id:`yoast-readability-analysis-collapsible-${t}`,initialIsOpen:r,children:this.renderResults(o,t)})}if("metabox"===t)return(0,u.jsx)(es,{target:"wpseo-metabox-readability-root",children:(0,u.jsxs)(Ar,{children:[(0,u.jsx)(Oe,{target:"wpseo-readability-score-icon",scoreIndicator:e.className}),this.renderResults(o,t)]})})}})})}}Br.propTypes={results:a().array.isRequired,marksButtonStatus:a().string.isRequired,overallScore:a().number,shouldUpsell:a().bool,shouldUpsellHighlighting:a().bool,isAiFeatureEnabled:a().bool,isElementor:a().bool,isTerm:a().bool},Br.defaultProps={overallScore:null,shouldUpsell:!1,shouldUpsellHighlighting:!1,isAiFeatureEnabled:!1,isElementor:!1,isTerm:!1};const Fr=(0,k.withSelect)(e=>{const{getReadabilityResults:s,getMarkButtonStatus:t,getIsElementorEditor:r,getIsAiFeatureEnabled:o,getIsTerm:i}=e("yoast-seo/editor");return{...s(),marksButtonStatus:t(),isElementor:r(),isAiFeatureEnabled:o(),isTerm:i()}})(Br);var qr=t(4925),$r=t.n(qr),Ur=t(7655),Wr=t.n(Ur),Hr=t(4259),zr=t.n(Hr);const Dr="yoast-seo/editor",Kr=({location:e})=>{const t=(0,R.useSvgAria)(),r=[{icon:$r(),text:(0,s.__)("Image alt attributes","wordpress-seo")},{icon:Wr(),text:(0,s.__)("Product identifiers","wordpress-seo")},{icon:zr(),text:(0,s.__)("SKUs","wordpress-seo")}],{metaboxUrl:o,sidebarUrl:i,elementorUrl:n,isElementorEditor:a,isWooSEOActive:l}=(0,k.useSelect)(e=>{const{selectLink:s}=e(Dr);return{metaboxUrl:s("https://yoa.st/seo-analysis-metabox-woocommerce"),sidebarUrl:s("https://yoa.st/seo-analysis-sidebar-woocommerce"),elementorUrl:s("https://yoa.st/seo-analysis-woocommerce-elementor"),isElementorEditor:e(Dr).getIsElementorEditor(),isWooSEOActive:e(Dr).getIsWooSeoActive()}},[]),c={metabox:o,sidebar:i,elementor:n},d=Yr(e,a);return(0,u.jsx)("div",{className:"yst-root",children:(0,u.jsxs)("div",{id:`woo-seo-analysis-upsell-ad-${d}`,className:"yst-border yst-border-woo-light yst-rounded-lg yst-shadow-md yst-p-4 yst-mt-2 yst-border-opacity-30",children:[(0,u.jsxs)(R.Title,{as:"h3",variant:"h3",className:"yst-text-woo-light yst-text-base yst-font-medium yst-mb-2 yst-flex yst-gap-2 yst-capitalize",children:[(0,s.__)("Premium SEO Analysis","wordpress-seo"),(0,u.jsx)(Ke(),{className:"yst-w-5 yst-scale-x-[-1]",...t})]}),(0,u.jsx)("p",{children:(0,s.__)("Benefit from all premium SEO analyses, plus product-specific checks like:","wordpress-seo")}),(0,u.jsx)("div",{className:"yst-pt-2 yst-mb-1",children:(0,u.jsx)("ul",{className:"yst-font-semibold",children:r.map(e=>(0,u.jsxs)("li",{className:"yst-flex yst-items-center yst-gap-2 yst-mb-1",children:[(0,u.jsx)(e.icon,{className:"yst-w-4 yst-text-slate-400"}),e.text]},e.text))})}),(0,u.jsxs)(R.Button,{variant:"upsell",as:"a",href:c[d],target:"_blank",rel:"noopener noreferrer",className:"yst-mt-2","data-action":"load-nfd-ctb","data-ctb-id":"f6a84663-465f-4cb5-8ba5-f7a6d72224b2",children:[(0,u.jsx)(F(),{className:"yst-w-4 yst-me-1.5",...t}),l?(0,s.__)("Unlock with Premium","wordpress-seo"):(0,s.sprintf)(/* translators: WooCommerce SEO */ /* translators: WooCommerce SEO */
348 -(0,s.__)("Get %s","wordpress-seo"),"WooCommerce SEO")]})]})})},Gr="yoast-seo/editor",Yr=(e,s)=>s?"elementor":e,Vr=({location:e})=>{const{metaboxUrl:t,sidebarUrl:r,elementorUrl:o,isElementorEditor:i,isWooCommerceActive:n,isProductEntity:a}=(0,k.useSelect)(e=>{const{selectLink:s}=e(Gr);return{metaboxUrl:s("https://yoa.st/premium-seo-analysis-metabox"),sidebarUrl:s("https://yoa.st/premium-seo-analysis-sidebar"),elementorUrl:s("https://yoa.st/premium-seo-analysis-elementor"),isElementorEditor:e(Gr).getIsElementorEditor(),isWooCommerceActive:e(Gr).getIsWooCommerceActive(),isProductEntity:e(Gr).getIsProductEntity()}},[]);if(n&&a)return(0,u.jsx)(Kr,{location:e});const l=(0,R.useSvgAria)(),c=Yr(e,i),d={metabox:t,sidebar:r,elementor:o};return(0,u.jsx)("div",{className:"yst-root",children:(0,u.jsxs)("div",{id:`premium-seo-analysis-upsell-ad-${c}`,className:"yst-border yst-border-primary-200 yst-rounded-lg yst-shadow-md yst-p-4 yst-mt-2",children:[(0,u.jsxs)(R.Title,{as:"h3",variant:"h3",className:"yst-text-primary-500 yst-text-base yst-font-medium yst-mb-2 yst-flex yst-gap-2 yst-capitalize",children:[(0,s.__)("Premium SEO Analysis","wordpress-seo"),(0,u.jsx)(de,{className:"yst-w-4",...l})]}),(0,u.jsx)("p",{children:(0,s.__)("Get deeper keyphrase insights and stronger headlines","wordpress-seo")}),(0,u.jsx)("div",{className:"yst-py-2 yst-ps-6",children:(0,u.jsxs)("ul",{className:"yst-list-disc yst-list-outside marker:yst-mr-0",children:[(0,u.jsx)("li",{className:"yst-mb-2 yst-list-item",children:O((0,s.sprintf)(/* translators: 1: Bold open tag, 2: Bold close tag */ /* translators: 1: Bold open tag, 2: Bold close tag */
349 -(0,s.__)("%1$sSynonyms & word form recognition:%2$s Write more natural, flowing content.","wordpress-seo"),"<strong>","</strong>"),{strong:(0,u.jsx)("strong",{})})}),(0,u.jsx)("li",{className:"yst-list-item",children:O((0,s.sprintf)(/* translators: 1: Bold open tag, 2: Bold close tag */ /* translators: 1: Bold open tag, 2: Bold close tag */
350 -(0,s.__)("%1$sExtra SEO assessments:%2$s See additional recommendation to improve your content.","wordpress-seo"),"<strong>","</strong>"),{strong:(0,u.jsx)("strong",{})})})]})}),(0,u.jsxs)(R.Button,{variant:"upsell",as:"a",href:d[c],target:"_blank",rel:"noopener noreferrer",className:"yst-mt-2","data-action":"load-nfd-ctb","data-ctb-id":"f6a84663-465f-4cb5-8ba5-f7a6d72224b2",children:[(0,u.jsx)(F(),{className:"yst-w-4 yst-me-1.5",...l}),(0,s.__)("Unlock with Premium","wordpress-seo")]})]})})},Zr=(0,j.getQueryArg)(window.location.href,"yoast-tab"),Qr=d().span`
437 +(0,s.__)("%1$sWord complexity%2$s: Is your vocabulary suited for a larger audience? %3$sYoast SEO Premium will tell you!%4$s","wordpress-seo"),"<span style='text-decoration: underline'>","</span>",`<a href="${o}" data-action="load-nfd-ctb" data-ctb-id="f6a84663-465f-4cb5-8ba5-f7a6d72224b2" target="_blank">`,"</a>"),markerId:"wordComplexity"}]:[]}render(){const e=gt(this.props.overallScore);return(0,i.isNil)(this.props.overallScore)&&(e.className="loading"),(0,u.jsx)(R.LocationConsumer,{children:t=>(0,u.jsx)(R.RootContext.Consumer,{children:({locationContext:o})=>{let r=[];if(this.props.shouldUpsell&&(r=this.getUpsellResults(t,o)),"sidebar"===t){const o="readability"===Pr;return(0,u.jsx)(k,{title:(0,s.__)("Readability analysis","wordpress-seo"),titleScreenReaderText:e.screenReaderReadabilityText,prefixIcon:Vs(e.className),prefixIconCollapsed:Vs(e.className),id:`yoast-readability-analysis-collapsible-${t}`,initialIsOpen:o,children:this.renderResults(r,t)})}if("metabox"===t)return(0,u.jsx)(xt,{target:"wpseo-metabox-readability-root",children:(0,u.jsxs)(Br,{children:[(0,u.jsx)(Js,{target:"wpseo-readability-score-icon",scoreIndicator:e.className}),this.renderResults(r,t)]})})}})})}}$r.propTypes={results:a().array.isRequired,marksButtonStatus:a().string.isRequired,overallScore:a().number,shouldUpsell:a().bool,shouldUpsellHighlighting:a().bool,isAiFeatureEnabled:a().bool,isElementor:a().bool,isTerm:a().bool},$r.defaultProps={overallScore:null,shouldUpsell:!1,shouldUpsellHighlighting:!1,isAiFeatureEnabled:!1,isElementor:!1,isTerm:!1};const qr=(0,C.withSelect)(e=>{const{getReadabilityResults:s,getMarkButtonStatus:t,getIsElementorEditor:o,getIsAiFeatureEnabled:r,getIsTerm:i}=e("yoast-seo/editor");return{...s(),marksButtonStatus:t(),isElementor:o(),isAiFeatureEnabled:r(),isTerm:i()}})($r);var Ur=t(4925),Wr=t.n(Ur),Hr=t(7655),zr=t.n(Hr),Dr=t(4259),Kr=t.n(Dr);const Gr="yoast-seo/editor",Yr=({location:e})=>{const t=(0,I.useSvgAria)(),o=[{icon:Wr(),text:(0,s.__)("Image alt attributes","wordpress-seo")},{icon:zr(),text:(0,s.__)("Product identifiers","wordpress-seo")},{icon:Kr(),text:(0,s.__)("SKUs","wordpress-seo")}],{metaboxUrl:r,sidebarUrl:i,elementorUrl:n,isElementorEditor:a,isWooSEOActive:l}=(0,C.useSelect)(e=>{const{selectLink:s}=e(Gr);return{metaboxUrl:s("https://yoa.st/seo-analysis-metabox-woocommerce"),sidebarUrl:s("https://yoa.st/seo-analysis-sidebar-woocommerce"),elementorUrl:s("https://yoa.st/seo-analysis-woocommerce-elementor"),isElementorEditor:e(Gr).getIsElementorEditor(),isWooSEOActive:e(Gr).getIsWooSeoActive()}},[]),c={metabox:r,sidebar:i,elementor:n},d=Zr(e,a);return(0,u.jsx)("div",{className:"yst-root",children:(0,u.jsxs)("div",{id:`woo-seo-analysis-upsell-ad-${d}`,className:"yst-border yst-border-woo-light yst-rounded-lg yst-shadow-md yst-p-4 yst-mt-2 yst-border-opacity-30",children:[(0,u.jsxs)(I.Title,{as:"h3",variant:"h3",className:"yst-text-woo-light yst-text-base yst-font-medium yst-mb-2 yst-flex yst-gap-2 yst-capitalize",children:[(0,s.__)("Premium SEO Analysis","wordpress-seo"),(0,u.jsx)(ct(),{className:"yst-w-5 yst-scale-x-[-1]",...t})]}),(0,u.jsx)("p",{children:(0,s.__)("Benefit from all premium SEO analyses, plus product-specific checks like:","wordpress-seo")}),(0,u.jsx)("div",{className:"yst-pt-2 yst-mb-1",children:(0,u.jsx)("ul",{className:"yst-font-semibold",children:o.map(e=>(0,u.jsxs)("li",{className:"yst-flex yst-items-center yst-gap-2 yst-mb-1",children:[(0,u.jsx)(e.icon,{className:"yst-w-4 yst-text-slate-400"}),e.text]},e.text))})}),(0,u.jsxs)(I.Button,{variant:"upsell",as:"a",href:c[d],target:"_blank",rel:"noopener noreferrer",className:"yst-mt-2","data-action":"load-nfd-ctb","data-ctb-id":"f6a84663-465f-4cb5-8ba5-f7a6d72224b2",children:[(0,u.jsx)(z(),{className:"yst-w-4 yst-me-1.5",...t}),l?(0,s.__)("Unlock with Premium","wordpress-seo"):(0,s.sprintf)(/* translators: WooCommerce SEO */ /* translators: WooCommerce SEO */
438 +(0,s.__)("Get %s","wordpress-seo"),"WooCommerce SEO")]})]})})},Vr="yoast-seo/editor",Zr=(e,s)=>s?"elementor":e,Qr=({location:e})=>{const{metaboxUrl:t,sidebarUrl:o,elementorUrl:r,isElementorEditor:i,isWooCommerceActive:n,isProductEntity:a}=(0,C.useSelect)(e=>{const{selectLink:s}=e(Vr);return{metaboxUrl:s("https://yoa.st/premium-seo-analysis-metabox"),sidebarUrl:s("https://yoa.st/premium-seo-analysis-sidebar"),elementorUrl:s("https://yoa.st/premium-seo-analysis-elementor"),isElementorEditor:e(Vr).getIsElementorEditor(),isWooCommerceActive:e(Vr).getIsWooCommerceActive(),isProductEntity:e(Vr).getIsProductEntity()}},[]);if(n&&a)return(0,u.jsx)(Yr,{location:e});const l=(0,I.useSvgAria)(),c=Zr(e,i),d={metabox:t,sidebar:o,elementor:r};return(0,u.jsx)("div",{className:"yst-root",children:(0,u.jsxs)("div",{id:`premium-seo-analysis-upsell-ad-${c}`,className:"yst-border yst-border-primary-200 yst-rounded-lg yst-shadow-md yst-p-4 yst-mt-2",children:[(0,u.jsxs)(I.Title,{as:"h3",variant:"h3",className:"yst-text-primary-500 yst-text-base yst-font-medium yst-mb-2 yst-flex yst-gap-2 yst-capitalize",children:[(0,s.__)("Premium SEO Analysis","wordpress-seo"),(0,u.jsx)(ye,{className:"yst-w-4",...l})]}),(0,u.jsx)("p",{children:(0,s.__)("Get deeper keyphrase insights and stronger headlines","wordpress-seo")}),(0,u.jsx)("div",{className:"yst-py-2 yst-ps-6",children:(0,u.jsxs)("ul",{className:"yst-list-disc yst-list-outside marker:yst-mr-0",children:[(0,u.jsx)("li",{className:"yst-mb-2 yst-list-item",children:q((0,s.sprintf)(/* translators: 1: Bold open tag, 2: Bold close tag */ /* translators: 1: Bold open tag, 2: Bold close tag */
439 +(0,s.__)("%1$sSynonyms & word form recognition:%2$s Write more natural, flowing content.","wordpress-seo"),"<strong>","</strong>"),{strong:(0,u.jsx)("strong",{})})}),(0,u.jsx)("li",{className:"yst-list-item",children:q((0,s.sprintf)(/* translators: 1: Bold open tag, 2: Bold close tag */ /* translators: 1: Bold open tag, 2: Bold close tag */
440 +(0,s.__)("%1$sExtra SEO assessments:%2$s See additional recommendation to improve your content.","wordpress-seo"),"<strong>","</strong>"),{strong:(0,u.jsx)("strong",{})})})]})}),(0,u.jsxs)(I.Button,{variant:"upsell",as:"a",href:d[c],target:"_blank",rel:"noopener noreferrer",className:"yst-mt-2","data-action":"load-nfd-ctb","data-ctb-id":"f6a84663-465f-4cb5-8ba5-f7a6d72224b2",children:[(0,u.jsx)(z(),{className:"yst-w-4 yst-me-1.5",...l}),(0,s.__)("Unlock with Premium","wordpress-seo")]})]})})},Xr=(0,E.getQueryArg)(window.location.href,"yoast-tab"),Jr=d().span`
351 441 font-size: 1em;
352 442 font-weight: bold;
353 443 margin: 1.5em 0 1em;
354 444 display: block;
355 -`;class Jr extends l.Component{constructor(...e){super(...e),Re(this,"renderAIOptimizeButton",(e,s)=>{const{isElementor:t,isAiFeatureEnabled:r,isPremium:o,isTerm:i}=this.props;if(!o||r)return Ir(e,t,i)&&(0,u.jsx)(Mr,{id:s,isPremium:o})})}renderTabIcon(e,s){return"metabox"!==e?null:(0,u.jsx)(Oe,{target:"wpseo-seo-score-icon",scoreIndicator:s})}render(){const e=Je(this.props.overallScore),{isPremium:t}=this.props;return"loading"!==e.className&&""===this.props.keyword&&(e.className="na",e.screenReaderReadabilityText=(0,s.__)("Enter a focus keyphrase to calculate the SEO score","wordpress-seo")),(0,u.jsx)(_.LocationConsumer,{children:r=>(0,u.jsx)(_.RootContext.Consumer,{children:()=>{const o="metabox"===r?y:w;return(0,u.jsxs)(l.Fragment,{children:[(0,u.jsxs)(o,{title:t?(0,s.__)("Premium SEO analysis","wordpress-seo"):(0,s.__)("SEO analysis","wordpress-seo"),titleScreenReaderText:e.screenReaderReadabilityText,prefixIcon:Ie(e.className),prefixIconCollapsed:Ie(e.className),subTitle:this.props.keyword,id:`yoast-seo-analysis-collapsible-${r}`,initialIsOpen:"seo"===Zr,children:[this.props.shouldUpsell&&(0,u.jsx)(Vr,{location:r}),(0,u.jsx)(Qr,{children:(0,s.__)("Analysis results","wordpress-seo")}),(0,u.jsx)(Qe,{results:this.props.results,marksButtonClassName:"yoast-tooltip yoast-tooltip-w",editButtonClassName:"yoast-tooltip yoast-tooltip-w",marksButtonStatus:this.props.marksButtonStatus,location:r,id:`yoast-seo-analysis-results-${r}`,shouldUpsellHighlighting:this.props.shouldUpsellHighlighting,highlightingUpsellLink:"shortlinks.upsell.sidebar.highlighting_seo_analysis",renderAIOptimizeButton:this.renderAIOptimizeButton})]}),this.renderTabIcon(r,e.className)]})}})})}}Jr.propTypes={results:a().array,marksButtonStatus:a().string,keyword:a().string,shouldUpsell:a().bool,overallScore:a().number,shouldUpsellHighlighting:a().bool,isElementor:a().bool,isAiFeatureEnabled:a().bool,isPremium:a().bool,isTerm:a().bool},Jr.defaultProps={results:[],marksButtonStatus:null,keyword:"",shouldUpsell:!1,overallScore:null,shouldUpsellHighlighting:!1,isElementor:!1,isAiFeatureEnabled:!1,isPremium:!1,isTerm:!1};const Xr=(0,k.withSelect)((e,s)=>{const{getFocusKeyphrase:t,getMarksButtonStatus:r,getResultsForKeyword:o,getIsElementorEditor:i,getIsPremium:n,getIsAiFeatureEnabled:a,getIsTerm:l}=e("yoast-seo/editor"),c=t();return{...o(c),marksButtonStatus:s.hideMarksButtons?"disabled":r(),keyword:c,isElementor:i(),isPremium:n(),isAiFeatureEnabled:a(),isTerm:l()}})(Jr);function eo(){const e=ss();return(0,i.get)(e,"multilingualPluginActive",!1)}const so=d().span`
445 +`;class ei extends l.Component{constructor(...e){super(...e),Ds(this,"renderAIOptimizeButton",(e,s)=>{const{isElementor:t,isAiFeatureEnabled:o,isPremium:r,isTerm:i}=this.props;if(!r||o)return Ar(e,t,i)&&(0,u.jsx)(Tr,{id:s,isPremium:r})})}renderTabIcon(e,s){return"metabox"!==e?null:(0,u.jsx)(Js,{target:"wpseo-seo-score-icon",scoreIndicator:s})}render(){const e=gt(this.props.overallScore),{isPremium:t}=this.props;return"loading"!==e.className&&""===this.props.keyword&&(e.className="na",e.screenReaderReadabilityText=(0,s.__)("Enter a focus keyphrase to calculate the SEO score","wordpress-seo")),(0,u.jsx)(R.LocationConsumer,{children:o=>(0,u.jsx)(R.RootContext.Consumer,{children:()=>{const r="metabox"===o?b:k;return(0,u.jsxs)(l.Fragment,{children:[(0,u.jsxs)(r,{title:t?(0,s.__)("Premium SEO analysis","wordpress-seo"):(0,s.__)("SEO analysis","wordpress-seo"),titleScreenReaderText:e.screenReaderReadabilityText,prefixIcon:Vs(e.className),prefixIconCollapsed:Vs(e.className),subTitle:this.props.keyword,id:`yoast-seo-analysis-collapsible-${o}`,initialIsOpen:"seo"===Xr,children:[this.props.shouldUpsell&&(0,u.jsx)(Qr,{location:o}),(0,u.jsx)(Jr,{children:(0,s.__)("Analysis results","wordpress-seo")}),(0,u.jsx)(mt,{results:this.props.results,marksButtonClassName:"yoast-tooltip yoast-tooltip-w",editButtonClassName:"yoast-tooltip yoast-tooltip-w",marksButtonStatus:this.props.marksButtonStatus,location:o,id:`yoast-seo-analysis-results-${o}`,shouldUpsellHighlighting:this.props.shouldUpsellHighlighting,highlightingUpsellLink:"shortlinks.upsell.sidebar.highlighting_seo_analysis",renderAIOptimizeButton:this.renderAIOptimizeButton})]}),this.renderTabIcon(o,e.className)]})}})})}}ei.propTypes={results:a().array,marksButtonStatus:a().string,keyword:a().string,shouldUpsell:a().bool,overallScore:a().number,shouldUpsellHighlighting:a().bool,isElementor:a().bool,isAiFeatureEnabled:a().bool,isPremium:a().bool,isTerm:a().bool},ei.defaultProps={results:[],marksButtonStatus:null,keyword:"",shouldUpsell:!1,overallScore:null,shouldUpsellHighlighting:!1,isElementor:!1,isAiFeatureEnabled:!1,isPremium:!1,isTerm:!1};const si=(0,C.withSelect)((e,s)=>{const{getFocusKeyphrase:t,getMarksButtonStatus:o,getResultsForKeyword:r,getIsElementorEditor:i,getIsPremium:n,getIsAiFeatureEnabled:a,getIsTerm:l}=e("yoast-seo/editor"),c=t();return{...r(c),marksButtonStatus:s.hideMarksButtons?"disabled":o(),keyword:c,isElementor:i(),isPremium:n(),isAiFeatureEnabled:a(),isTerm:l()}})(ei);function ti(){const e=wt();return(0,i.get)(e,"multilingualPluginActive",!1)}const oi=d().span`
356 446 font-size: 1em;
357 447 font-weight: bold;
358 448 margin: 0 0 8px;
359 449 display: block;
360 -`,to=d().div`
450 +`,ri=d().div`
361 451 padding: 16px;
362 -`,ro=d()(Xe)`
452 +`,ii=d()(yt)`
363 453 margin: -8px 0 -4px 4px;
364 -`,oo=d().p`
454 +`,ni=d().p`
365 455 min-height: 24px;
366 456 margin: 12px 0 0 0;
367 457 padding: 0;
368 458 display: flex;
369 459 align-items: flex-start;
370 -`,io=d()(r.SvgIcon)`
460 +`,ai=d()(o.SvgIcon)`
371 461 margin: 3px 11px 0 0; // icon 13 + 11 right margin = 24 for the 8px grid.
372 -`,no=({results:e=[],overallScore:t=null,marksButtonStatus:o,shouldUpsellHighlighting:n=!1})=>{const a=wpseoAdminL10n["shortlinks.inclusive_language_analysis_info"];function c(){return(0,u.jsxs)(l.Fragment,{children:[(0,u.jsxs)(so,{children:[(0,s.__)("Analysis results","wordpress-seo"),(0,u.jsx)(ro,{href:a,className:"dashicons",children:(0,u.jsx)("span",{className:"screen-reader-text",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
373 -(0,s.__)("Learn more about the inclusive language analysis","wordpress-seo")})})]}),(0,u.jsx)(Qe,{results:e,marksButtonClassName:"yoast-tooltip yoast-tooltip-w",marksButtonStatus:o,resultCategoryLabels:{problems:(0,s.__)("Non-inclusive","wordpress-seo"),improvements:(0,s.__)("Potentially non-inclusive","wordpress-seo")},highlightingUpsellLink:"shortlinks.upsell.sidebar.highlighting_inclusive_analysis",shouldUpsellHighlighting:n})]})}const d=O((0,s.sprintf)(/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag. */ /* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag. */
374 -(0,s.__)("%1$sInclusive language%2$s: We haven't detected any potentially non-inclusive phrases. Great work!","wordpress-seo"),"<a>","</a>"),{a:(0,u.jsx)("a",{href:a,target:"_blank",rel:"noreferrer"})});function p(){const e=(0,s.__)("We noticed that you are using a multilingual plugin. Please be aware that this analysis feedback is intended only for texts written in English.","wordpress-seo");return(0,u.jsx)(r.Alert,{type:"info",children:e})}function m(){return(0,u.jsxs)(l.Fragment,{children:[(0,u.jsxs)(so,{children:[(0,s.__)("Analysis results","wordpress-seo"),(0,u.jsx)(ro,{href:a,className:"dashicons",children:(0,u.jsx)("span",{className:"screen-reader-text",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
375 -(0,s.__)("Learn more about the inclusive language analysis","wordpress-seo")})})]}),(0,u.jsxs)(oo,{children:[(0,u.jsx)(io,{icon:"circle",color:"#7ad03a",size:"13px"}),(0,u.jsx)("span",{children:d})]})]})}const h=Je(t);return(0,i.isNil)(t)&&(h.className="loading"),(0,u.jsx)(_.LocationConsumer,{children:t=>"sidebar"===t?function(e,t){return(0,u.jsxs)(w,{title:(0,s.__)("Inclusive language","wordpress-seo"),titleScreenReaderText:t.screenReaderInclusiveLanguageText,prefixIcon:Ie(t.className),prefixIconCollapsed:Ie(t.className),id:"yoast-inclusive-language-analysis-collapsible-sidebar",children:[eo()?p():null,e.length>=1?c():m()]})}(e,h):"metabox"===t?function(e,s){return(0,u.jsx)(Pe,{target:"wpseo-metabox-inclusive-language-root",children:(0,u.jsxs)(to,{children:[(0,u.jsx)(Oe,{target:"wpseo-inclusive-language-score-icon",scoreIndicator:s.className}),eo()?p():null,e.length>=1?c():m()]})})}(e,h):void 0})};no.propTypes={results:a().array,marksButtonStatus:a().oneOf(["enabled","disabled","hidden"]).isRequired,overallScore:a().number,shouldUpsellHighlighting:a().bool};const ao=(0,k.withSelect)(e=>{const{getInclusiveLanguageResults:s,getMarkButtonStatus:t}=e("yoast-seo/editor");return{...s(),marksButtonStatus:t()}})(no);var lo=t(3941),co=t.n(lo),uo=t(5941),po=t.n(uo),mo=t(5462),ho=t.n(mo),go=t(6112),yo=t.n(go),xo=t(1509),wo=t.n(xo);const fo=window.wp.blocks;var bo=t(3705),vo=t.n(bo),ko=t(6625),_o=t.n(ko);const jo=({id:e})=>{var t,r;const o=Boolean(null===(t=window)||void 0===t||null===(r=t.wpseoScriptData)||void 0===r?void 0:r.isPage),i=No(Lo,[{title:(0,s.__)("Siblings","wordpress-seo"),name:"yoast-seo/siblings",isPremiumBlock:!0},{title:(0,s.__)("Sub-pages","wordpress-seo"),name:"yoast-seo/subpages",isPremiumBlock:!0}],o).map(e=>"yoast-seo/siblings"===e.name?{...e,icon:vo()}:"yoast-seo/subpages"===e.name?{...e,icon:_o()}:e);return(0,u.jsx)("ul",{className:"yst-my-2",children:i.map((s,t)=>{const{icon:r,title:o}=s;return(0,u.jsxs)("li",{className:"yst-flex yst-gap-2 yst-mb-2 yst-items-center",children:[(0,u.jsx)(r,{className:"yst-w-4 yst-h-4 yst-shrink-0 yst-inline yst-stroke-slate-400"}),(0,u.jsx)("p",{className:"yst-text-slate-800 yst-font-medium",children:o})]},`${e}-upsell-benefit-${t}`)})})};jo.propTypes={id:a().string.isRequired};const So=({isOpen:e,closeModal:t,location:r})=>{const{locationContext:o}=(0,_.useRootContext)(),i=wpseoAdminL10n["sidebar"===r?"shortlinks.upsell.sidebar.content_blocks":"shortlinks.upsell.metabox.content_blocks"],n=(0,l.useCallback)(()=>(0,u.jsx)(jo,{id:"yoast-content-blocks-upsell"}),[]);return(0,u.jsx)(Ge,{isOpen:e,onClose:t,id:"yoast-content-blocks-upsell",upsellLink:(0,j.addQueryArgs)(i,{context:o}),modalTitle:(0,s.__)("Add rich content blocks with Premium","wordpress-seo"),title:(0,s.__)("Make your post more engaging at a click","wordpress-seo"),description:(0,s.__)("Add rich elements that improve readability, structure, and SEO. Easily insert smart blocks to enrich your content directly in the Block Editor. Includes:","wordpress-seo"),benefits:n,note:(0,s.__)("Get a tailored experience for the Block Editor","wordpress-seo"),ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2"})};So.propTypes={isOpen:a().bool.isRequired,closeModal:a().func.isRequired,location:a().oneOf(["sidebar","metabox"]).isRequired};const Co=({showUpsellBadge:e,blockName:t,location:r})=>{const{insertBlock:o,replaceBlock:i}=(0,k.useDispatch)("core/block-editor"),{blockInsertionPoint:n,editorBlocks:a,isTemplateLocked:c,postContentBlock:d}=(0,k.useSelect)(e=>({blockInsertionPoint:e("core/block-editor").getBlockInsertionPoint(),editorBlocks:e("core/editor").getEditorBlocks(),isTemplateLocked:"template-locked"===e("core/editor").getRenderingMode(),postContentBlock:e("core/block-editor").getBlocksByName("core/post-content")}),[]),[p,m]=(0,l.useState)(!1),[h,g]=(0,l.useState)(!1),[y,,,x,w]=(0,R.useToggleState)(!1),f=(0,l.useCallback)(e=>{var s;null==e||null===(s=e.currentTarget)||void 0===s||s.blur(),g(!1)},[]),b=(0,l.useCallback)(s=>{if(f(s),e)x();else{var r;m(!0);const e=n.index,s=a[e-1],l=!!s&&"core/paragraph"===s.name&&""===(null===(r=s.attributes.content)||void 0===r?void 0:r.text),u=(0,fo.createBlock)(t);setTimeout(()=>{l?i(s.clientId,u):c?null!=d&&d.length&&o(u,void 0,d[0]):o(u,e),m(!1)},300)}},[e,t,o,i,n,a,c,d]),v=(0,l.useCallback)(()=>{g(!0)},[]),_=(0,l.useCallback)(()=>{g(!1)},[]),j=`yoast-add-block-button${p?" yoast-add-block-button--clicked":""}${h&&!p?" yoast-tooltip yoast-tooltip-w":""}`,S="yoast-add-block-button__icon"+(p?" yoast-add-block-button__icon--clicked":""),C=h?(0,s.__)("Add block to content.","wordpress-seo"):(0,s.__)("Add block","wordpress-seo");return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(So,{isOpen:y,closeModal:w,location:r}),(0,u.jsx)("button",{className:j,"aria-label":C,onClick:b,onMouseEnter:v,onMouseLeave:_,onFocus:v,onBlur:_,children:(0,u.jsx)(wo(),{className:S})})]})};Co.propTypes={showUpsellBadge:a().bool.isRequired,blockName:a().string.isRequired,location:a().string.isRequired};const Ro=({blockTitle:e,blockName:s,isPremiumBlock:t,hasNewBadgeLabel:o,renderNewBadgeLabel:i,location:n})=>{const{isPremium:a,addedBlock:c}=(0,k.useSelect)(e=>({isPremium:e("yoast-seo/editor").getIsPremium(),addedBlock:e("core/block-editor").getBlocksByName(s)}),[s]),d=(0,R.useSvgAria)(),p=t&&!a,[m,h]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{0===c.length?h(!1):h(!0)},[c]),(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("hr",{className:"yst-border-t-slate-200 yst-mx-0 yst-w-auto yst-my-4"}),(0,u.jsxs)("div",{className:"yst-flex yst-items-center",children:[(0,u.jsxs)("div",{className:"yst-flex yst-items-center yst-flex-grow yst-p-0 yst-gap-2 yst-ms-2",children:[(0,u.jsx)(r.SvgIcon,{icon:"circle",size:"4px"}),(0,u.jsx)("span",{className:"yst-font-medium",children:e}),o&&i()]}),!m&&(0,u.jsxs)("div",{className:"yst-relative yst-inline-block",children:[(0,u.jsx)(Co,{showUpsellBadge:p,blockName:s,location:n}),p&&(0,u.jsx)("div",{className:"yst-root",children:(0,u.jsx)(R.Badge,{className:"yst-absolute yst-p-0.5 yst--end-[6.5px] yst--top-[6.5px]",size:"small",variant:"upsell",children:(0,u.jsx)(qe(),{className:"yst-w-2.5 yst-h-2.5 yst-shrink-0",...d})})})]}),m&&(0,u.jsx)("div",{className:"yst-flex yst-flex-row yst-p-1.5",children:(0,u.jsx)(Qs(),{className:"yst-h-4 yst-w-4 yst-stroke-green-700"})})]})]})};Ro.propTypes={blockTitle:a().string.isRequired,blockName:a().string.isRequired,isPremiumBlock:a().bool.isRequired,hasNewBadgeLabel:a().bool.isRequired,renderNewBadgeLabel:a().func.isRequired,location:a().oneOf(["metabox","sidebar"]).isRequired};const Eo=[{title:(0,s.__)("Breadcrumbs","wordpress-seo"),name:"yoast-seo/breadcrumbs",isPremiumBlock:!1},{title:(0,s.__)("FAQ","wordpress-seo"),name:"yoast/faq-block",isPremiumBlock:!1},{title:(0,s.__)("How-to","wordpress-seo"),name:"yoast/how-to-block",isPremiumBlock:!1}],Lo=[{title:(0,s.__)("AI Summarize","wordpress-seo"),name:"yoast-seo/ai-summarize",isPremiumBlock:!0,icon:ho()},{title:(0,s.__)("Estimated reading time","wordpress-seo"),name:"yoast-seo/estimated-reading-time",isPremiumBlock:!0,icon:co()},{title:(0,s.__)("Related links","wordpress-seo"),name:"yoast-seo/related-links",isPremiumBlock:!0,icon:po()},{title:(0,s.__)("Table of contents","wordpress-seo"),name:"yoast-seo/table-of-contents",isPremiumBlock:!0,icon:yo()}],No=(e,s,t)=>t?[...e,...s].sort((e,s)=>e.title.localeCompare(s.title)):e;window.yoast=window.yoast||{},window.yoast.externals=window.yoast.externals||{},window.yoast.externals.components={CollapsibleCornerstone:b,TopicInputs:Se,KeywordInput:Se,ReadabilityAnalysis:Fr,SeoAnalysis:Xr,InclusiveLanguageAnalysis:ao,ContentBlocks:()=>{var e,t;const r=(0,l.useContext)(_.LocationContext),o="metabox"===r?y:w,i=!window.wpseoAiGenerator?Lo.filter(e=>"yoast-seo/ai-summarize"!==e.name):Lo,n=Boolean(null===(e=window)||void 0===e||null===(t=e.wpseoScriptData)||void 0===t?void 0:t.isPage),a=(e=>e?[{title:(0,s.__)("Siblings","wordpress-seo"),name:"yoast-seo/siblings",isPremiumBlock:!0},{title:(0,s.__)("Subpages","wordpress-seo"),name:"yoast-seo/subpages",isPremiumBlock:!0}]:[])(n),c=((e,s,t)=>{const r=e.find(e=>"yoast-seo/table-of-contents"===e.name),o=e.filter(e=>"yoast-seo/table-of-contents"!==e.name);return t?o.concat(s,r?[r]:[],Eo):e.concat(Eo)})(i,a,n),d=(0,l.useCallback)(()=>(0,u.jsx)("div",{className:"yst-root",children:(0,u.jsx)(R.Badge,{variant:"info",size:"small",children:(0,s.__)("New","wordpress-seo")})}),[]),p=`yoast-content-blocks-collapsible-${r}`;return(0,u.jsxs)(o,{id:p,title:(0,s.__)("Content blocks","wordpress-seo"),hasNewBadgeLabel:!0,renderNewBadgeLabel:d,children:[(0,u.jsx)("div",{className:"yst-font-normal yst-text-sm",children:(0,s.__)("While writing your post, add custom Yoast blocks directly from here to enhance your content.","wordpress-seo")}),c.map(e=>(0,u.jsx)(Ro,{blockTitle:e.title,blockName:e.name,isPremiumBlock:e.isPremiumBlock,hasNewBadgeLabel:"AI Summarize"===e.title,renderNewBadgeLabel:d,location:r},e.name))]})}}})()})();
462 +`,li=({results:e=[],overallScore:t=null,marksButtonStatus:r,shouldUpsellHighlighting:n=!1})=>{const a=wpseoAdminL10n["shortlinks.inclusive_language_analysis_info"];function c(){return(0,u.jsxs)(l.Fragment,{children:[(0,u.jsxs)(oi,{children:[(0,s.__)("Analysis results","wordpress-seo"),(0,u.jsx)(ii,{href:a,className:"dashicons",children:(0,u.jsx)("span",{className:"screen-reader-text",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
463 +(0,s.__)("Learn more about the inclusive language analysis","wordpress-seo")})})]}),(0,u.jsx)(mt,{results:e,marksButtonClassName:"yoast-tooltip yoast-tooltip-w",marksButtonStatus:r,resultCategoryLabels:{problems:(0,s.__)("Non-inclusive","wordpress-seo"),improvements:(0,s.__)("Potentially non-inclusive","wordpress-seo")},highlightingUpsellLink:"shortlinks.upsell.sidebar.highlighting_inclusive_analysis",shouldUpsellHighlighting:n})]})}const d=q((0,s.sprintf)(/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag. */ /* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag. */
464 +(0,s.__)("%1$sInclusive language%2$s: We haven't detected any potentially non-inclusive phrases. Great work!","wordpress-seo"),"<a>","</a>"),{a:(0,u.jsx)("a",{href:a,target:"_blank",rel:"noreferrer"})});function p(){const e=(0,s.__)("We noticed that you are using a multilingual plugin. Please be aware that this analysis feedback is intended only for texts written in English.","wordpress-seo");return(0,u.jsx)(o.Alert,{type:"info",children:e})}function h(){return(0,u.jsxs)(l.Fragment,{children:[(0,u.jsxs)(oi,{children:[(0,s.__)("Analysis results","wordpress-seo"),(0,u.jsx)(ii,{href:a,className:"dashicons",children:(0,u.jsx)("span",{className:"screen-reader-text",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
465 +(0,s.__)("Learn more about the inclusive language analysis","wordpress-seo")})})]}),(0,u.jsxs)(ni,{children:[(0,u.jsx)(ai,{icon:"circle",color:"#7ad03a",size:"13px"}),(0,u.jsx)("span",{children:d})]})]})}const m=gt(t);return(0,i.isNil)(t)&&(m.className="loading"),(0,u.jsx)(R.LocationConsumer,{children:t=>"sidebar"===t?function(e,t){return(0,u.jsxs)(k,{title:(0,s.__)("Inclusive language","wordpress-seo"),titleScreenReaderText:t.screenReaderInclusiveLanguageText,prefixIcon:Vs(t.className),prefixIconCollapsed:Vs(t.className),id:"yoast-inclusive-language-analysis-collapsible-sidebar",children:[ti()?p():null,e.length>=1?c():h()]})}(e,m):"metabox"===t?function(e,s){return(0,u.jsx)(Qs,{target:"wpseo-metabox-inclusive-language-root",children:(0,u.jsxs)(ri,{children:[(0,u.jsx)(Js,{target:"wpseo-inclusive-language-score-icon",scoreIndicator:s.className}),ti()?p():null,e.length>=1?c():h()]})})}(e,m):void 0})};li.propTypes={results:a().array,marksButtonStatus:a().oneOf(["enabled","disabled","hidden"]).isRequired,overallScore:a().number,shouldUpsellHighlighting:a().bool};const ci=(0,C.withSelect)(e=>{const{getInclusiveLanguageResults:s,getMarkButtonStatus:t}=e("yoast-seo/editor");return{...s(),marksButtonStatus:t()}})(li);var di=t(3941),ui=t.n(di),pi=t(5941),hi=t.n(pi),mi=t(5462),gi=t.n(mi),yi=t(6112),xi=t.n(yi),wi=t(1509),fi=t.n(wi);const bi=window.wp.blocks;var vi=t(3705),ki=t.n(vi),ji=t(6625),_i=t.n(ji);const Si=({id:e})=>{var t,o;const r=Boolean(null===(t=window)||void 0===t||null===(o=t.wpseoScriptData)||void 0===o?void 0:o.isPage),i=Ii(Ni,[{title:(0,s.__)("Siblings","wordpress-seo"),name:"yoast-seo/siblings",isPremiumBlock:!0},{title:(0,s.__)("Sub-pages","wordpress-seo"),name:"yoast-seo/subpages",isPremiumBlock:!0}],r).map(e=>"yoast-seo/siblings"===e.name?{...e,icon:ki()}:"yoast-seo/subpages"===e.name?{...e,icon:_i()}:e);return(0,u.jsx)("ul",{className:"yst-my-2",children:i.map((s,t)=>{const{icon:o,title:r}=s;return(0,u.jsxs)("li",{className:"yst-flex yst-gap-2 yst-mb-2 yst-items-center",children:[(0,u.jsx)(o,{className:"yst-w-4 yst-h-4 yst-shrink-0 yst-inline yst-stroke-slate-400"}),(0,u.jsx)("p",{className:"yst-text-slate-800 yst-font-medium",children:r})]},`${e}-upsell-benefit-${t}`)})})};Si.propTypes={id:a().string.isRequired};const Ci=({isOpen:e,closeModal:t,location:o})=>{const{locationContext:r}=(0,R.useRootContext)(),i=wpseoAdminL10n["sidebar"===o?"shortlinks.upsell.sidebar.content_blocks":"shortlinks.upsell.metabox.content_blocks"],n=(0,l.useCallback)(()=>(0,u.jsx)(Si,{id:"yoast-content-blocks-upsell"}),[]);return(0,u.jsx)(dt,{isOpen:e,onClose:t,id:"yoast-content-blocks-upsell",upsellLink:(0,E.addQueryArgs)(i,{context:r}),modalTitle:(0,s.__)("Add rich content blocks with Premium","wordpress-seo"),title:(0,s.__)("Make your post more engaging at a click","wordpress-seo"),description:(0,s.__)("Add rich elements that improve readability, structure, and SEO. Easily insert smart blocks to enrich your content directly in the Block Editor. Includes:","wordpress-seo"),benefits:n,note:(0,s.__)("Get a tailored experience for the Block Editor","wordpress-seo"),ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2"})};Ci.propTypes={isOpen:a().bool.isRequired,closeModal:a().func.isRequired,location:a().oneOf(["sidebar","metabox"]).isRequired};const Ri=({showUpsellBadge:e,blockName:t,location:o})=>{const{insertBlock:r,replaceBlock:i}=(0,C.useDispatch)("core/block-editor"),{blockInsertionPoint:n,editorBlocks:a,isTemplateLocked:c,postContentBlock:d}=(0,C.useSelect)(e=>({blockInsertionPoint:e("core/block-editor").getBlockInsertionPoint(),editorBlocks:e("core/editor").getEditorBlocks(),isTemplateLocked:"template-locked"===e("core/editor").getRenderingMode(),postContentBlock:e("core/block-editor").getBlocksByName("core/post-content")}),[]),[p,h]=(0,l.useState)(!1),[m,g]=(0,l.useState)(!1),[y,,,x,w]=(0,I.useToggleState)(!1),f=(0,l.useCallback)(e=>{var s;null==e||null===(s=e.currentTarget)||void 0===s||s.blur(),g(!1)},[]),b=(0,l.useCallback)(s=>{if(f(s),e)x();else{var o;h(!0);const e=n.index,s=a[e-1],l=!!s&&"core/paragraph"===s.name&&""===(null===(o=s.attributes.content)||void 0===o?void 0:o.text),u=(0,bi.createBlock)(t);setTimeout(()=>{l?i(s.clientId,u):c?null!=d&&d.length&&r(u,void 0,d[0]):r(u,e),h(!1)},300)}},[e,t,r,i,n,a,c,d]),v=(0,l.useCallback)(()=>{g(!0)},[]),k=(0,l.useCallback)(()=>{g(!1)},[]),j=`yoast-add-block-button${p?" yoast-add-block-button--clicked":""}${m&&!p?" yoast-tooltip yoast-tooltip-w":""}`,_="yoast-add-block-button__icon"+(p?" yoast-add-block-button__icon--clicked":""),S=m?(0,s.__)("Add block to content.","wordpress-seo"):(0,s.__)("Add block","wordpress-seo");return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Ci,{isOpen:y,closeModal:w,location:o}),(0,u.jsx)("button",{className:j,"aria-label":S,onClick:b,onMouseEnter:v,onMouseLeave:k,onFocus:v,onBlur:k,children:(0,u.jsx)(fi(),{className:_})})]})};Ri.propTypes={showUpsellBadge:a().bool.isRequired,blockName:a().string.isRequired,location:a().string.isRequired};const Ei=({blockTitle:e,blockName:s,isPremiumBlock:t,hasNewBadgeLabel:r,renderNewBadgeLabel:i,location:n})=>{const{isPremium:a,addedBlock:c}=(0,C.useSelect)(e=>({isPremium:e("yoast-seo/editor").getIsPremium(),addedBlock:e("core/block-editor").getBlocksByName(s)}),[s]),d=(0,I.useSvgAria)(),p=t&&!a,[h,m]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{0===c.length?m(!1):m(!0)},[c]),(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("hr",{className:"yst-border-t-slate-200 yst-mx-0 yst-w-auto yst-my-4"}),(0,u.jsxs)("div",{className:"yst-flex yst-items-center",children:[(0,u.jsxs)("div",{className:"yst-flex yst-items-center yst-flex-grow yst-p-0 yst-gap-2 yst-ms-2",children:[(0,u.jsx)(o.SvgIcon,{icon:"circle",size:"4px"}),(0,u.jsx)("span",{className:"yst-font-medium",children:e}),r&&i()]}),!h&&(0,u.jsxs)("div",{className:"yst-relative yst-inline-block",children:[(0,u.jsx)(Ri,{showUpsellBadge:p,blockName:s,location:n}),p&&(0,u.jsx)("div",{className:"yst-root",children:(0,u.jsx)(I.Badge,{className:"yst-absolute yst-p-0.5 yst--end-[6.5px] yst--top-[6.5px]",size:"small",variant:"upsell",children:(0,u.jsx)(tt(),{className:"yst-w-2.5 yst-h-2.5 yst-shrink-0",...d})})})]}),h&&(0,u.jsx)("div",{className:"yst-flex yst-flex-row yst-p-1.5",children:(0,u.jsx)(Gt(),{className:"yst-h-4 yst-w-4 yst-stroke-green-700"})})]})]})};Ei.propTypes={blockTitle:a().string.isRequired,blockName:a().string.isRequired,isPremiumBlock:a().bool.isRequired,hasNewBadgeLabel:a().bool.isRequired,renderNewBadgeLabel:a().func.isRequired,location:a().oneOf(["metabox","sidebar"]).isRequired};const Li=[{title:(0,s.__)("Breadcrumbs","wordpress-seo"),name:"yoast-seo/breadcrumbs",isPremiumBlock:!1},{title:(0,s.__)("FAQ","wordpress-seo"),name:"yoast/faq-block",isPremiumBlock:!1},{title:(0,s.__)("How-to","wordpress-seo"),name:"yoast/how-to-block",isPremiumBlock:!1}],Ni=[{title:(0,s.__)("AI Summarize","wordpress-seo"),name:"yoast-seo/ai-summarize",isPremiumBlock:!0,icon:gi()},{title:(0,s.__)("Estimated reading time","wordpress-seo"),name:"yoast-seo/estimated-reading-time",isPremiumBlock:!0,icon:ui()},{title:(0,s.__)("Related links","wordpress-seo"),name:"yoast-seo/related-links",isPremiumBlock:!0,icon:hi()},{title:(0,s.__)("Table of contents","wordpress-seo"),name:"yoast-seo/table-of-contents",isPremiumBlock:!0,icon:xi()}],Ii=(e,s,t)=>t?[...e,...s].sort((e,s)=>e.title.localeCompare(s.title)):e;window.yoast=window.yoast||{},window.yoast.externals=window.yoast.externals||{},window.yoast.externals.components={CollapsibleCornerstone:_,TopicInputs:Hs,KeywordInput:Hs,ReadabilityAnalysis:qr,SeoAnalysis:si,InclusiveLanguageAnalysis:ci,ContentBlocks:()=>{var e,t;const o=(0,l.useContext)(R.LocationContext),r="metabox"===o?b:k,i=!window.wpseoAiGenerator?Ni.filter(e=>"yoast-seo/ai-summarize"!==e.name):Ni,n=Boolean(null===(e=window)||void 0===e||null===(t=e.wpseoScriptData)||void 0===t?void 0:t.isPage),a=(e=>e?[{title:(0,s.__)("Siblings","wordpress-seo"),name:"yoast-seo/siblings",isPremiumBlock:!0},{title:(0,s.__)("Subpages","wordpress-seo"),name:"yoast-seo/subpages",isPremiumBlock:!0}]:[])(n),c=((e,s,t)=>{const o=e.find(e=>"yoast-seo/table-of-contents"===e.name),r=e.filter(e=>"yoast-seo/table-of-contents"!==e.name);return t?r.concat(s,o?[o]:[],Li):e.concat(Li)})(i,a,n),d=(0,l.useCallback)(()=>(0,u.jsx)("div",{className:"yst-root",children:(0,u.jsx)(I.Badge,{variant:"info",size:"small",children:(0,s.__)("New","wordpress-seo")})}),[]),p=`yoast-content-blocks-collapsible-${o}`;return(0,u.jsxs)(r,{id:p,title:(0,s.__)("Content blocks","wordpress-seo"),hasNewBadgeLabel:!0,renderNewBadgeLabel:d,children:[(0,u.jsx)("div",{className:"yst-font-normal yst-text-sm",children:(0,s.__)("While writing your post, add custom Yoast blocks directly from here to enhance your content.","wordpress-seo")}),c.map(e=>(0,u.jsx)(Ei,{blockTitle:e.title,blockName:e.name,isPremiumBlock:e.isPremiumBlock,hasNewBadgeLabel:"AI Summarize"===e.title,renderNewBadgeLabel:d,location:o},e.name))]})}}})()})();