????JFIF??x?x????'
Server IP : 104.21.112.1 / Your IP : 216.73.216.111 Web Server : LiteSpeed System : Linux premium151.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 User : tempvsty ( 647) PHP Version : 8.0.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/././././tempvsty/peekmysite.com/wp-content/plugins/wordpress-seo/js/dist/ |
Upload File : |
(()=>{var e={6746:(e,t,s)=>{"use strict";var r="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},a=i(s(9196)),n=i(s(9156)),o=i(s(6743));function i(e){return e&&e.__esModule?e:{default:e}}var l=void 0;function c(e,t){var s,o,i,d,u,p,m,h,g=[],y={};for(p=0;p<e.length;p++)if("string"!==(u=e[p]).type){if(!t.hasOwnProperty(u.value)||void 0===t[u.value])throw new Error("Invalid interpolation, missing component node: `"+u.value+"`");if("object"!==r(t[u.value]))throw new Error("Invalid interpolation, component node must be a ReactElement or null: `"+u.value+"`","\n> "+l);if("componentClose"===u.type)throw new Error("Missing opening component token: `"+u.value+"`");if("componentOpen"===u.type){s=t[u.value],i=p;break}g.push(t[u.value])}else g.push(u.value);return s&&(d=function(e,t){var s,r,a=t[e],n=0;for(r=e+1;r<t.length;r++)if((s=t[r]).value===a.value){if("componentOpen"===s.type){n++;continue}if("componentClose"===s.type){if(0===n)return r;n--}}throw new Error("Missing closing component token `"+a.value+"`")}(i,e),m=c(e.slice(i+1,d),t),o=a.default.cloneElement(s,{},m),g.push(o),d<e.length-1&&(h=c(e.slice(d+1),t),g=g.concat(h))),1===g.length?g[0]:(g.forEach((function(e,t){e&&(y["interpolation-child-"+t]=e)})),(0,n.default)(y))}t.Z=function(e){var t=e.mixedString,s=e.components,a=e.throwErrors;if(l=t,!s)return t;if("object"!==(void 0===s?"undefined":r(s))){if(a)throw new Error("Interpolation Error: unable to process `"+t+"` because components is not an object");return t}var n=(0,o.default)(t);try{return c(n,s)}catch(e){if(a)throw new Error("Interpolation Error: unable to process `"+t+"` because of error `"+e.message+"`");return t}}},6743:e=>{"use strict";function t(e){return e.match(/^\{\{\//)?{type:"componentClose",value:e.replace(/\W/g,"")}:e.match(/\/\}\}$/)?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.match(/^\{\{/)?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}e.exports=function(e){return e.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(t)}},9156:(e,t,s)=>{"use strict";var r=s(9196),a="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,n=s(7942),o=s(9179),i=s(397),l=".",c=":",d="function"==typeof Symbol&&Symbol.iterator,u="@@iterator";function p(e,t){return e&&"object"==typeof e&&null!=e.key?(s=e.key,r={"=":"=0",":":"=2"},"$"+(""+s).replace(/[=:]/g,(function(e){return r[e]}))):t.toString(36);var s,r}function m(e,t,s,r){var n,i=typeof e;if("undefined"!==i&&"boolean"!==i||(e=null),null===e||"string"===i||"number"===i||"object"===i&&e.$$typeof===a)return s(r,e,""===t?l+p(e,0):t),1;var h=0,g=""===t?l:t+c;if(Array.isArray(e))for(var y=0;y<e.length;y++)h+=m(n=e[y],g+p(n,y),s,r);else{var f=function(e){var t=e&&(d&&e[d]||e[u]);if("function"==typeof t)return t}(e);if(f)for(var w,b=f.call(e),E=0;!(w=b.next()).done;)h+=m(n=w.value,g+p(n,E++),s,r);else if("object"===i){var v=""+e;o(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===v?"object with keys {"+Object.keys(e).join(", ")+"}":v,"")}}return h}var h=/\/+/g;function g(e){return(""+e).replace(h,"$&/")}var y,f,w=b,b=function(e){var t=this;if(t.instancePool.length){var s=t.instancePool.pop();return t.call(s,e),s}return new t(e)};function E(e,t,s,r){this.result=e,this.keyPrefix=t,this.func=s,this.context=r,this.count=0}function v(e,t,s){var a,o,i=e.result,l=e.keyPrefix,c=e.func,d=e.context,u=c.call(d,t,e.count++);Array.isArray(u)?k(u,i,s,n.thatReturnsArgument):null!=u&&(r.isValidElement(u)&&(a=u,o=l+(!u.key||t&&t.key===u.key?"":g(u.key)+"/")+s,u=r.cloneElement(a,{key:o},void 0!==a.props?a.props.children:void 0)),i.push(u))}function k(e,t,s,r,a){var n="";null!=s&&(n=g(s)+"/");var o=E.getPooled(t,n,r,a);!function(e,t,s){null==e||m(e,"",t,s)}(e,v,o),E.release(o)}E.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},y=function(e,t,s,r){var a=this;if(a.instancePool.length){var n=a.instancePool.pop();return a.call(n,e,t,s,r),n}return new a(e,t,s,r)},(f=E).instancePool=[],f.getPooled=y||w,f.poolSize||(f.poolSize=10),f.release=function(e){var t=this;o(e instanceof t,"Trying to release an instance into a pool of a different type."),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},e.exports=function(e){if("object"!=typeof e||!e||Array.isArray(e))return i(!1,"React.addons.createFragment only accepts a single object. Got: %s",e),e;if(r.isValidElement(e))return i(!1,"React.addons.createFragment does not accept a ReactElement without a wrapper object."),e;o(1!==e.nodeType,"React.addons.createFragment(...): Encountered an invalid child; DOM elements are not valid children of React components.");var t=[];for(var s in e)k(e[s],t,s,n.thatReturnsArgument);return t}},7942:e=>{"use strict";function t(e){return function(){return e}}var s=function(){};s.thatReturns=t,s.thatReturnsFalse=t(!1),s.thatReturnsTrue=t(!0),s.thatReturnsNull=t(null),s.thatReturnsThis=function(){return this},s.thatReturnsArgument=function(e){return e},e.exports=s},9179:e=>{"use strict";e.exports=function(e,t,s,r,a,n,o,i){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[s,r,a,n,o,i],d=0;(l=new Error(t.replace(/%s/g,(function(){return c[d++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},397:(e,t,s)=>{"use strict";var r=s(7942);e.exports=r},4530:(e,t)=>{var s;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var s=arguments[t];if(s){var n=typeof s;if("string"===n||"number"===n)e.push(s);else if(Array.isArray(s)){if(s.length){var o=a.apply(null,s);o&&e.push(o)}}else if("object"===n){if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]")){e.push(s.toString());continue}for(var i in s)r.call(s,i)&&s[i]&&e.push(i)}}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(s=function(){return a}.apply(t,[]))||(e.exports=s)}()},9196:e=>{"use strict";e.exports=window.React}},t={};function s(r){var a=t[r];if(void 0!==a)return a.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,s),n.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};s.r(e),s.d(e,{refreshDelay:()=>i});var t={};s.r(t),s.d(t,{default:()=>f,initializationDone:()=>w,sortResultsByIdentifier:()=>y});var r={};s.r(r),s.d(r,{default:()=>Y,getIconForScore:()=>z});var a={};s.r(a),s.d(a,{doAjaxRequest:()=>qs});var n={};s.r(n),s.d(n,{applyReplaceUsingPlugin:()=>tr,createLabelFromName:()=>Ys,excerptFromContent:()=>er,fillReplacementVariables:()=>Ks,handlePrefixes:()=>zs,mapCustomFields:()=>Js,mapCustomTaxonomies:()=>Xs,nonReplaceVars:()=>js,prepareCustomFieldForDispatch:()=>Zs,prepareCustomTaxonomyForDispatch:()=>Qs,pushNewReplaceVar:()=>Vs,replaceSpaces:()=>Gs});const o=window.yoast.externals.contexts,i=500,l=window.lodash;function c(){return(0,l.get)(window,"wpseoScriptData.metabox",{intl:{},isRtl:!1})}const d=window.wp.i18n,u=window.yoast.analysis,p=window.wp.hooks,m=window.yoast.externals.redux;function h(){}let g=!1;function y(e){return e.sort(((e,t)=>e._identifier.localeCompare(t._identifier)))}function f(e,t,s,r,a){if(!g)return;const n=u.Paper.parse(t());e.analyze(n).then((o=>{const{result:{seo:i,readability:l,inclusiveLanguage:c}}=o;if(i){const e=i[""];e.results.forEach((e=>{e.getMarker=()=>()=>s(n,e.marks)})),e.results=y(e.results),r.dispatch(m.actions.setSeoResultsForKeyword(n.getKeyword(),e.results)),r.dispatch(m.actions.setOverallSeoScore(e.score,n.getKeyword())),r.dispatch(m.actions.refreshSnippetEditor()),a.saveScores(e.score,n.getKeyword())}l&&(l.results.forEach((e=>{e.getMarker=()=>()=>s(n,e.marks)})),l.results=y(l.results),r.dispatch(m.actions.setReadabilityResults(l.results)),r.dispatch(m.actions.setOverallReadabilityScore(l.score)),r.dispatch(m.actions.refreshSnippetEditor()),a.saveContentScore(l.score)),c&&(c.results.forEach((e=>{e.getMarker=()=>()=>s(n,e.marks)})),c.results=y(c.results),r.dispatch(m.actions.setInclusiveLanguageResults(c.results)),r.dispatch(m.actions.setOverallInclusiveLanguageScore(c.score)),r.dispatch(m.actions.refreshSnippetEditor()),a.saveInclusiveLanguageScore(c.score)),(0,p.doAction)("yoast.analysis.refresh",o,{paper:n,worker:e,collectData:t,applyMarks:s,store:r,dataCollector:a})})).catch(h)}function w(){g=!0}var b=s(9196),E=s.n(b);const v=window.wp.element,k=window.yoast.styledComponents;var x=s.n(k);const _=window.yoast.propTypes;var S=s.n(_);const R=window.yoast.componentsNew,C=window.yoast.helpers,L=window.yoast.styleGuide,I=L.colors.$color_bad,T=L.colors.$palette_error_background,N=L.colors.$color_grey_text_light,P=L.colors.$palette_error_text,M=x().div` display: flex; flex-direction: column; `,A=x().label` font-size: var(--yoast-font-size-default); font-weight: var(--yoast-font-weight-bold); ${(0,C.getDirectionalStyle)("margin-right: 4px","margin-left: 4px")}; `,O=x().span` margin-bottom: 0.5em; `,F=x()(R.InputField)` flex: 1 !important; box-sizing: border-box; max-width: 100%; margin: 0; // Reset margins inherited from WordPress. // Hide native X in Edge and IE11. &::-ms-clear { display: none; } &.has-error { border-color: ${I} !important; background-color: ${T} !important; &:focus { box-shadow: 0 0 2px ${I} !important; } } `,q=x().ul` color: ${P}; list-style-type: disc; list-style-position: outside; margin: 0; margin-left: 1.2em; `,$=x().li` color: ${P}; margin: 0 0 0.5em 0; `,B=(0,R.addFocusStyle)(x().button` border: 1px solid transparent; box-shadow: none; background: none; flex: 0 0 32px; height: 32px; max-width: 32px; padding: 0; cursor: pointer; `);B.propTypes={type:S().string,focusColor:S().string,focusBackgroundColor:S().string,focusBorderColor:S().string},B.defaultProps={type:"button",focusColor:L.colors.$color_button_text_hover,focusBackgroundColor:"transparent",focusBorderColor:L.colors.$color_blue};const D=x()(R.SvgIcon)` margin-top: 4px; `,W=x().div` display: flex; flex-direction: row; align-items: center; &.has-remove-keyword-button { ${F} { ${(0,C.getDirectionalStyle)("padding-right: 40px","padding-left: 40px")}; } ${B} { ${(0,C.getDirectionalStyle)("margin-left: -32px","margin-right: -32px")}; } } `;class U extends v.Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}handleChange(e){this.props.onChange(e.target.value)}renderLabel(){const{id:e,label:t,helpLink:s}=this.props;return(0,b.createElement)(O,null,(0,b.createElement)(A,{htmlFor:e},t),s)}renderErrorMessages(){const e=[...this.props.errorMessages];return!(0,l.isEmpty)(e)&&(0,b.createElement)(q,null,e.map(((e,t)=>(0,b.createElement)($,{key:t},(0,b.createElement)("span",{role:"alert"},e)))))}render(){const{id:e,showLabel:t,keyword:s,onRemoveKeyword:r,onBlurKeyword:a,onFocusKeyword:n,hasError:o}=this.props,i=!t,c=r!==l.noop;return(0,b.createElement)(M,null,t&&this.renderLabel(),o&&this.renderErrorMessages(),(0,b.createElement)(W,{className:c?"has-remove-keyword-button":null},(0,b.createElement)(F,{"aria-label":i?this.props.label:null,type:"text",id:e,className:o?"has-error":null,onChange:this.handleChange,onFocus:n,onBlur:a,value:s,autoComplete:"off"}),c&&(0,b.createElement)(B,{onClick:r,focusBoxShadowColor:"#084A67"},(0,b.createElement)(D,{size:"18px",icon:"times-circle",color:N}))))}}U.propTypes={id:S().string.isRequired,showLabel:S().bool,keyword:S().string,onChange:S().func.isRequired,onRemoveKeyword:S().func,onBlurKeyword:S().func,onFocusKeyword:S().func,label:S().string.isRequired,helpLink:S().node,hasError:S().bool,errorMessages:S().arrayOf(S().string)},U.defaultProps={showLabel:!0,keyword:"",onRemoveKeyword:l.noop,onBlurKeyword:l.noop,onFocusKeyword:l.noop,helpLink:null,hasError:!1,errorMessages:[]};const H=U;function j(e,t=""){const s=e.getIdentifier(),r={score:e.score,rating:u.interpreters.scoreToRating(e.score),hasMarks:e.hasMarks(),marker:e.getMarker(),id:s,text:e.text,markerId:t.length>0?`${t}:${s}`:s,hasBetaBadge:e.hasBetaBadge(),hasJumps:e.hasJumps(),hasAIFixes:e.hasAIFixes(),editFieldName:e.editFieldName};return"ok"===r.rating&&(r.rating="OK"),r}function K(e,t){switch(e.rating){case"error":t.errorsResults.push(e);break;case"feedback":t.considerationsResults.push(e);break;case"bad":t.problemsResults.push(e);break;case"OK":t.improvementsResults.push(e);break;case"good":t.goodResults.push(e)}return t}function z(e){switch(e){case"loading":return{icon:"loading-spinner",color:L.colors.$color_green_medium_light};case"not-set":return{icon:"seo-score-none",color:L.colors.$color_score_icon};case"noindex":return{icon:"seo-score-none",color:L.colors.$color_noindex};case"good":return{icon:"seo-score-good",color:L.colors.$color_green_medium};case"ok":return{icon:"seo-score-ok",color:L.colors.$color_ok};default:return{icon:"seo-score-bad",color:L.colors.$color_red}}}function Y(e,t=""){let s={errorsResults:[],problemsResults:[],improvementsResults:[],goodResults:[],considerationsResults:[]};if(!e)return s;for(let r=0;r<e.length;r++){const a=e[r];a.text&&(s=K(j(a,t),s))}return s}const V=(0,C.makeOutboundLink)(x().a` display: inline-block; position: relative; outline: none; text-decoration: none; border-radius: 100%; width: 24px; height: 24px; margin: -4px 0; vertical-align: middle; color: ${L.colors.$color_help_text}; &:hover, &:focus { color: ${L.colors.$color_snippet_focus}; } // Overwrite the default blue active color for links. &:active { color: ${L.colors.$color_help_text}; } &::before { position: absolute; top: 0; left: 0; padding: 2px; content: "\f223"; } `),G=x()(R.Collapsible)` h2 > button { padding-left: 24px; padding-top: 16px; &:hover { background-color: #f0f0f0; } } div[class^="collapsible_content"] { padding: 24px 0; margin: 0 24px; border-top: 1px solid rgba(0,0,0,0.2); } `,Z=window.wp.components,Q="yoast yoast-gutenberg-modal",X=e=>{const{title:t,className:s,showYoastIcon:r,additionalClassName:a,...n}=e,o=r?(0,b.createElement)("span",{className:"yoast-icon"}):null;return(0,b.createElement)(Z.Modal,{title:t,className:`${s} ${a}`,icon:o,...n},e.children)};X.propTypes={title:S().string,className:S().string,showYoastIcon:S().bool,children:S().oneOfType([S().node,S().arrayOf(S().node)]),additionalClassName:S().string},X.defaultProps={title:"Yoast SEO",className:Q,showYoastIcon:!0,children:null,additionalClassName:""};const J=X,ee=window.yoast.socialMetadataForms,te=e=>({type:e.subtype,width:e.width,height:e.height,url:e.url,id:e.id,sizes:e.sizes,alt:e.alt||e.title||e.name});const se=({hiddenField:e,hiddenFieldImageId:t,hiddenFieldFallbackImageId:s,hasImageValidation:r,...a})=>{const[n,o]=(0,v.useState)(null!==document.getElementById(s)),i=(0,v.useMemo)((()=>document.getElementById(e))),l=(0,v.useMemo)((()=>document.getElementById(t)));let c=null;c=s&&document.getElementById(s)?(0,v.useMemo)((()=>document.getElementById(s))):l;const[d,u]=(0,v.useState)({url:i?i.value:"",id:c?parseInt(c.value,10):"",alt:""}),[p,m]=(0,v.useState)([]),h=(0,v.useCallback)((e=>{i&&(i.value=e.url),c&&(c.value=e.id)})),g=(0,v.useCallback)((()=>{(function(e){const t=window.wp.media();return t.on("select",(()=>{const s=t.state().get("selection").first();e(te(s.attributes))})),t})((e=>{c=l,u(e),h(e),r&&m((0,C.validateFacebookImage)(e)),o(!1)})).open()}),[r,h]),y=(0,v.useCallback)((()=>{c=l;const e={url:"",id:"",alt:""};u(e),h(e),m([]),o(!0)}),[h]);return(0,v.useEffect)((()=>{var e;d.id&&!d.alt&&(e=d.id,new Promise(((t,s)=>{window.wp.media.attachment||s(),window.wp.media.attachment(e).fetch().then((e=>{t(te(e))})).catch((()=>s()))}))).then((e=>u(e)))}),[d]),(0,b.createElement)(R.ImageSelect,{...a,usingFallback:n,imageUrl:d.url,imageId:d.id,imageAltText:d.alt,onClick:g,onRemoveImageClick:y,warnings:p})};se.propTypes={hiddenField:S().string.isRequired,hiddenFieldImageId:S().string,hiddenFieldFallbackImageId:S().string,hasImageValidation:S().bool},se.defaultProps={hiddenFieldImageId:"",hiddenFieldFallbackImageId:"",hasImageValidation:!1};const re=se;function ae({target:e,children:t}){let s=e;return"string"==typeof e&&(s=document.getElementById(e)),s?(0,v.createPortal)(t,s):null}function ne({target:e,label:t,hasPreview:s,hiddenField:r,hiddenFieldImageId:a,hiddenFieldFallbackImageId:n,selectImageButtonId:o,replaceImageButtonId:i,removeImageButtonId:l,hasNewBadge:c,isDisabled:d,hasPremiumBadge:u,hasImageValidation:p}){return(0,b.createElement)(ae,{target:e},(0,b.createElement)(re,{label:t,hasPreview:s,hiddenField:r,hiddenFieldImageId:a,hiddenFieldFallbackImageId:n,selectImageButtonId:o,replaceImageButtonId:i,removeImageButtonId:l,hasNewBadge:c,isDisabled:d,hasPremiumBadge:u,hasImageValidation:p}))}ae.propTypes={target:S().oneOfType([S().string,S().object]).isRequired,children:S().node.isRequired},ne.propTypes={target:S().string.isRequired,label:S().string.isRequired,hasPreview:S().bool.isRequired,hiddenField:S().string.isRequired,hiddenFieldImageId:S().string,hiddenFieldFallbackImageId:S().string,selectImageButtonId:S().string,replaceImageButtonId:S().string,removeImageButtonId:S().string,hasNewBadge:S().bool,isDisabled:S().bool,hasPremiumBadge:S().bool,hasImageValidation:S().bool},ne.defaultProps={hiddenFieldImageId:"",hiddenFieldFallbackImageId:"",selectImageButtonId:"",replaceImageButtonId:"",removeImageButtonId:"",hasNewBadge:!1,isDisabled:!1,hasPremiumBadge:!1,hasImageValidation:!1};const oe=({target:e,scoreIndicator:t})=>(0,b.createElement)(ae,{target:e},(0,b.createElement)(R.SvgIcon,{...z(t)}));oe.propTypes={target:S().string.isRequired,scoreIndicator:S().string.isRequired};const ie=oe,le=e=>{const[t,s]=(0,v.useState)(!1),{prefixIcon:r}=e;return(0,b.createElement)("div",{className:"yoast components-panel__body "+(t?"is-opened":"")},(0,b.createElement)("h2",{className:"components-panel__body-title"},(0,b.createElement)("button",{onClick:function(){s(!t)},className:"components-button components-panel__body-toggle",type:"button",id:e.buttonId},(0,b.createElement)("span",{className:"yoast-icon-span",style:{fill:`${r&&r.color||""}`}},r&&(0,b.createElement)(R.SvgIcon,{icon:r.icon,color:r.color,size:r.size})),(0,b.createElement)("span",{className:"yoast-title-container"},(0,b.createElement)("div",{className:"yoast-title"},e.title),(0,b.createElement)("div",{className:"yoast-subtitle"},e.subTitle)),e.hasBetaBadgeLabel&&(0,b.createElement)(R.BetaBadge,null),(0,b.createElement)("span",{className:"yoast-chevron","aria-hidden":"true"}))),t&&e.children)},ce=le;le.propTypes={title:S().string.isRequired,children:S().oneOfType([S().node,S().arrayOf(S().node)]).isRequired,prefixIcon:S().object,subTitle:S().string,hasBetaBadgeLabel:S().bool,buttonId:S().string},le.defaultProps={prefixIcon:null,subTitle:"",hasBetaBadgeLabel:!1,buttonId:null};const de=({children:e})=>(0,b.createElement)("div",null,e);de.propTypes={renderPriority:S().number.isRequired,children:S().node.isRequired};const ue=de,pe=({theme:e,location:t,children:s})=>(0,b.createElement)(o.LocationProvider,{value:t},(0,b.createElement)(k.ThemeProvider,{theme:e},s));pe.propTypes={theme:S().object.isRequired,location:S().oneOf(["sidebar","metabox","modal"]).isRequired,children:S().element.isRequired};const me=pe,he=window.wp.compose,ge=window.wp.data,ye=e=>(0,b.createElement)("div",{className:"yoast components-panel__body"},(0,b.createElement)("h2",{className:"components-panel__body-title"},(0,b.createElement)("button",{id:e.id,onClick:e.onClick,className:"components-button components-panel__body-toggle",type:"button"},e.prefixIcon&&(0,b.createElement)("span",{className:"yoast-icon-span",style:{fill:`${e.prefixIcon&&e.prefixIcon.color||""}`}},(0,b.createElement)(R.SvgIcon,{size:e.prefixIcon.size,icon:e.prefixIcon.icon})),(0,b.createElement)("span",{className:"yoast-title-container"},(0,b.createElement)("div",{className:"yoast-title"},e.title),(0,b.createElement)("div",{className:"yoast-subtitle"},e.subTitle)),e.children,e.suffixIcon&&(0,b.createElement)(R.SvgIcon,{size:e.suffixIcon.size,icon:e.suffixIcon.icon}),e.SuffixHeroIcon))),fe=ye;ye.propTypes={onClick:S().func.isRequired,title:S().string.isRequired,id:S().string,subTitle:S().string,suffixIcon:S().object,SuffixHeroIcon:S().object,prefixIcon:S().object,children:S().node},ye.defaultProps={id:"",suffixIcon:null,SuffixHeroIcon:null,prefixIcon:null,subTitle:"",children:null};const we=({id:e,postTypeName:t,children:s,title:r,isOpen:a,close:n,open:i,shouldCloseOnClickOutside:l,showChangesWarning:c,SuffixHeroIcon:u})=>(0,b.createElement)(v.Fragment,null,a&&(0,b.createElement)(o.LocationProvider,{value:"modal"},(0,b.createElement)(J,{title:r,onRequestClose:n,additionalClassName:"yoast-collapsible-modal yoast-post-settings-modal",id:"id",shouldCloseOnClickOutside:l},(0,b.createElement)("div",{className:"yoast-content-container"},(0,b.createElement)("div",{className:"yoast-modal-content"},s)),(0,b.createElement)("div",{className:"yoast-notice-container"},(0,b.createElement)("hr",null),(0,b.createElement)("div",{className:"yoast-button-container"},c&&(0,b.createElement)("p",null,/* Translators: %s translates to the Post Label in singular form */ (0,d.sprintf)((0,d.__)("Make sure to save your %s for changes to take effect","wordpress-seo"),t)),(0,b.createElement)("button",{className:"yoast-button yoast-button--primary yoast-button--post-settings-modal",type:"button",onClick:n},/* Translators: %s translates to the Post Label in singular form */ (0,d.sprintf)((0,d.__)("Return to your %s","wordpress-seo"),t)))))),(0,b.createElement)(fe,{id:e+"-open-button",title:r,SuffixHeroIcon:u,suffixIcon:u?null:{size:"20px",icon:"pencil-square"},onClick:i}));we.propTypes={id:S().string.isRequired,postTypeName:S().string.isRequired,children:S().oneOfType([S().node,S().arrayOf(S().node)]).isRequired,title:S().string.isRequired,isOpen:S().bool.isRequired,open:S().func.isRequired,close:S().func.isRequired,shouldCloseOnClickOutside:S().bool,showChangesWarning:S().bool,SuffixHeroIcon:S().object},we.defaultProps={shouldCloseOnClickOutside:!0,showChangesWarning:!0};const be=we,Ee=(0,he.compose)([(0,ge.withSelect)(((e,t)=>{const{getPostOrPageString:s,getIsModalOpen:r}=e("yoast-seo/editor");return{postTypeName:s(),isOpen:r(t.id)}})),(0,ge.withDispatch)(((e,t)=>{const{openEditorModal:s,closeEditorModal:r}=e("yoast-seo/editor");return{open:()=>s(t.id),close:r}}))])(be),ve=(0,he.compose)([(0,ge.withSelect)(((e,t)=>{const{isAlertDismissed:s}=e(t.store||"yoast-seo/editor");return{isAlertDismissed:s(t.alertKey)}})),(0,ge.withDispatch)(((e,t)=>{const{dismissAlert:s}=e(t.store||"yoast-seo/editor");return{onDismissed:()=>s(t.alertKey)}}))])(R.Alert),ke=window.yoast.analysisReport,xe=window.yoast.uiLibrary,_e=b.forwardRef((function(e,t){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),b.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"}))})),Se=(x().div` min-width: 600px; @media screen and ( max-width: 680px ) { min-width: 0; width: 86vw; } `,x().div` @media screen and ( min-width: 600px ) { max-width: 420px; } `),Re=(x()(R.Icon)` float: ${(0,C.getDirectionalStyle)("right","left")}; margin: ${(0,C.getDirectionalStyle)("0 0 16px 16px","0 16px 16px 0")}; && { width: 150px; height: 150px; @media screen and ( max-width: 680px ) { width: 80px; height: 80px; } } `,window.wp.url),Ce=[(0,d.__)("AI tools included","wordpress-seo"),(0,d.sprintf)(/* translators: %1$s expands to "Yoast SEO academy". */ (0,d.__)("%1$s access","wordpress-seo"),"Yoast SEO academy"),(0,d.__)("24/7 support","wordpress-seo")],Le=[(0,d.__)("Generate SEO optimized metadata in seconds with AI","wordpress-seo"),(0,d.__)("Make your articles visible, be seen in Google News","wordpress-seo"),(0,d.__)("Built to get found by search, AI, and real users","wordpress-seo"),(0,d.__)("Easy Local SEO. Show up in Google Maps results","wordpress-seo"),(0,d.__)("Internal links and redirect management, easy","wordpress-seo"),(0,d.__)("Access to friendly help when you need it, day or night","wordpress-seo")],Ie=(e=!1)=>e?Ce:Le,Te=(e=!1)=>{if(e)return Ce;const t=[...Le];return t[1]=(0,d.__)("Boost visibility for your products, from 10 or 10,000+","wordpress-seo"),t},Ne=(e,t)=>{try{return(0,v.createInterpolateElement)(e,t)}catch(t){return console.error("Error in translation for:",e,t),e}},Pe=x().div` padding: 25px 32px 32px; color: #303030; `,Me=x().ul` margin: 0; padding: 0; li { list-style-image: var(--yoast-svg-icon-check); margin: 0.5rem 0 0 1.5rem; line-height: 1.4em; &::marker { font-size: 1.5rem; } } `,Ae=x().span` display: block; margin-top: 4px; `,Oe=x().h2` margin-top: 0; margin-bottom: 0.25rem; color: #303030; font-size: 0.8125rem; font-weight: 600; `,Fe=x().p` display: block; margin: 0.25rem 0 1rem 0 !important; max-width: 420px; `,qe=x().hr` margin-top: 1.5rem; margin-bottom: 1rem; border-top: 0; border-bottom: 1px solid #E2E8F0; `,$e=x().div` text-align: center; `,Be=x().a` width: 100%; `,De=(0,C.makeOutboundLink)(Be);class We extends v.Component{constructor(e){super(e)}createBenefitsList(e){return e.length>0&&(0,b.createElement)(Me,{role:"list"},e.map(((e,t)=>(0,b.createElement)("li",{key:`upsell-benefit-${t}`},Ne(e,{strong:(0,b.createElement)("strong",null)})))))}render(){const e=(0,ge.select)("yoast-seo/editor").isPromotionActive("black-friday-2024-promotion");return(0,b.createElement)(v.Fragment,null,e&&(0,b.createElement)("div",{className:"yst-flex 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"},(0,b.createElement)("div",{className:"yst-mx-auto"},(0,d.__)("30% OFF - BLACK FRIDAY","wordpress-seo"))),(0,b.createElement)(Pe,null,(0,b.createElement)(Oe,null,this.props.title),(0,b.createElement)(Fe,null,this.props.description),(0,b.createElement)($e,null,(0,b.createElement)(De,{...this.props.upsellButton},this.props.upsellButtonText,this.props.upsellButtonHasCaret&&(0,b.createElement)("span",{"aria-hidden":"true",className:"yoast-button-upsell__caret"})),(0,b.createElement)(Ae,{id:this.props.upsellButton["aria-describedby"]},this.props.upsellButtonLabel)),(0,b.createElement)(qe,null),(0,b.createElement)(Oe,null,this.props.benefitsTitle),this.createBenefitsList(this.props.benefits)))}}We.propTypes={title:S().node,benefits:S().array,benefitsTitle:S().node,description:S().node,upsellButton:S().object,upsellButtonText:S().string.isRequired,upsellButtonLabel:S().string,upsellButtonHasCaret:S().bool},We.defaultProps={title:null,description:null,benefits:[],benefitsTitle:null,upsellButton:{href:"",className:"button button-primary"},upsellButtonLabel:"",upsellButtonHasCaret:!0};const Ue=We,He=(0,d.__)("Check your text on even more SEO criteria and get an enhanced keyphrase analysis, making it easier to optimize your content.","wordpress-seo"),je=e=>{const{locationContext:t}=(0,o.useRootContext)(),s=(0,Re.addQueryArgs)(wpseoAdminL10n[e.buyLink],{context:t});return(0,b.createElement)(Ue,{title:(0,d.__)("Get more help with writing content that ranks","wordpress-seo"),description:e.description,benefitsTitle:(0,d.sprintf)(/* translators: %s expands to 'Yoast SEO Premium'. */ (0,d.__)("%s also gives you:","wordpress-seo"),"Yoast SEO Premium"),benefits:Ie(),upsellButtonText:(0,d.sprintf)(/* translators: %s expands to 'Yoast SEO Premium'. */ (0,d.__)("Unlock with %s","wordpress-seo"),"Yoast SEO Premium"),upsellButton:{href:s,className:"yoast-button-upsell",rel:null,"data-ctb-id":"f6a84663-465f-4cb5-8ba5-f7a6d72224b2","data-action":"load-nfd-ctb"},upsellButtonLabel:(0,d.__)("1 year of premium support and updates included!","wordpress-seo")})};je.propTypes={buyLink:S().string.isRequired,description:S().string},je.defaultProps={description:He};const Ke=je;class ze extends v.Component{constructor(e){super(e);const t=this.props.results;this.state={mappedResults:{}},null!==t&&(this.state={mappedResults:Y(t,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:Y(this.props.results,this.props.keywordKey)})}createMarkButton({ariaLabel:e,id:t,className:s,status:r,onClick:a,isPressed:n}){return(0,b.createElement)(v.Fragment,null,(0,b.createElement)(R.IconButtonToggle,{marksButtonStatus:r,className:s,onClick:a,id:t,icon:"eye",pressed:n,ariaLabel:e}),this.props.shouldUpsellHighlighting&&(0,b.createElement)("div",{className:"yst-root"},(0,b.createElement)(xe.Badge,{className:"yst-absolute yst-px-[3px] yst-py-[3px] yst--end-[6.5px] yst--top-[6.5px]",size:"small",variant:"upsell"},(0,b.createElement)(_e,{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,t){this.props.setActiveMarker(e),t()}handleMarkButtonClick(e,t){const s=this.props.keywordKey.length>0?`${this.props.keywordKey}:${e}`:e;this.props.activeAIFixesButton&&this.props.setActiveAIFixesButton(null),s===this.props.activeMarker?this.deactivateMarker():this.activateMarker(s,t)}handleResultsChange(e,t,s){const r=this.props.keywordKey.length>0?`${this.props.keywordKey}:${e}`:e;r===this.props.activeMarker&&(s?(0,l.isUndefined)(t)||this.activateMarker(r,t):this.deactivateMarker())}focusOnKeyphraseField(e){const t=this.props.keywordKey,s=""===t?"focus-keyword-input-"+e:"yoast-keyword-input-"+t+"-"+e,r=document.getElementById(s);r.focus(),r.scrollIntoView({behavior:"auto",block:"center",inline:"center"})}focusOnGooglePreviewField(e,t){let s;s="metaDescriptionKeyword"===e||"metaDescriptionLength"===e?"description":"titleWidth"===e||"keyphraseInSEOTitle"===e?"title":"slug";const r=document.getElementById("yoast-google-preview-"+s+"-"+t);r.focus(),r.scrollIntoView({behavior:"auto",block:"center",inline:"center"})}handleEditButtonClick(e){const t=this.props.location;"functionWordsInKeyphrase"!==e&&"keyphraseLength"!==e?(["metaDescriptionKeyword","metaDescriptionLength","titleWidth","keyphraseInSEOTitle","slugKeyword"].includes(e)&&this.handleGooglePreviewFocus(t,e),(0,p.doAction)("yoast.focus.input",e)):this.focusOnKeyphraseField(t)}handleGooglePreviewFocus(e,t){if("sidebar"===e)document.getElementById("yoast-search-appearance-modal-open-button").click(),setTimeout((()=>this.focusOnGooglePreviewField(t,"modal")),500);else{const s=document.getElementById("yoast-snippet-editor-metabox");s&&"false"===s.getAttribute("aria-expanded")?(s.click(),setTimeout((()=>this.focusOnGooglePreviewField(t,e)),100)):this.focusOnGooglePreviewField(t,e)}}removeMarkers(){window.YoastSEO.analysis.applyMarks(new u.Paper("",{}),[])}renderHighlightingUpsell(e,t){const s=(0,d.__)("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 e&&(0,b.createElement)(J,{title:(0,d.__)("Unlock Premium SEO analysis","wordpress-seo"),onRequestClose:t,additionalClassName:"",className:`${Q} yoast-gutenberg-modal__box yoast-gutenberg-modal__no-padding`,id:"yoast-premium-seo-analysis-highlighting-modal",shouldCloseOnClickOutside:!0},(0,b.createElement)(Se,null,(0,b.createElement)(Ke,{buyLink:this.props.highlightingUpsellLink,description:s})))}render(){const{mappedResults:e}=this.state,{errorsResults:t,improvementsResults:s,goodResults:r,considerationsResults:a,problemsResults:n}=e,{upsellResults:o,resultCategoryLabels:i}=this.props,l={errors:(0,d.__)("Errors","wordpress-seo"),problems:(0,d.__)("Problems","wordpress-seo"),improvements:(0,d.__)("Improvements","wordpress-seo"),considerations:(0,d.__)("Considerations","wordpress-seo"),goodResults:(0,d.__)("Good results","wordpress-seo")},c=Object.assign(l,i);let u=this.props.marksButtonStatus;return"enabled"===u&&this.props.shortcodesForParsing.length>0&&(u="disabled"),(0,b.createElement)(v.Fragment,null,(0,b.createElement)(ke.ContentAnalysis,{errorsResults:t,problemsResults:n,upsellResults:o,improvementsResults:s,considerationsResults:a,goodResults:r,activeMarker:this.props.activeMarker,onMarkButtonClick:this.handleMarkButtonClick,onEditButtonClick:this.handleEditButtonClick,marksButtonClassName:this.props.marksButtonClassName,editButtonClassName:this.props.editButtonClassName,marksButtonStatus:u,headingLevel:3,keywordKey:this.props.keywordKey,isPremium:this.props.isPremium,resultCategoryLabels:c,onResultChange:this.handleResultsChange,shouldUpsellHighlighting:this.props.shouldUpsellHighlighting,renderAIOptimizeButton:this.props.renderAIOptimizeButton,renderHighlightingUpsell:this.renderHighlightingUpsell,markButtonFactory:this.createMarkButton}))}}ze.propTypes={results:S().array,upsellResults:S().array,marksButtonClassName:S().string,editButtonClassName:S().string,marksButtonStatus:S().oneOf(["enabled","disabled","hidden"]),setActiveMarker:S().func.isRequired,setMarkerPauseStatus:S().func.isRequired,setActiveAIFixesButton:S().func.isRequired,activeMarker:S().string,activeAIFixesButton:S().string,keywordKey:S().string,location:S().string,isPremium:S().bool,resultCategoryLabels:S().shape({errors:S().string,problems:S().string,improvements:S().string,considerations:S().string,goodResults:S().string}),shortcodesForParsing:S().array,shouldUpsellHighlighting:S().bool,highlightingUpsellLink:S().string,renderAIOptimizeButton:S().func},ze.defaultProps={results:null,upsellResults:[],marksButtonStatus:"enabled",marksButtonClassName:"",editButtonClassName:"",activeMarker:null,activeAIFixesButton:null,keywordKey:"",location:"",isPremium:!1,resultCategoryLabels:{},shortcodesForParsing:[],shouldUpsellHighlighting:!1,highlightingUpsellLink:"",renderAIOptimizeButton:()=>{}};const Ye=ze,Ve=(0,he.compose)([(0,ge.withSelect)((e=>{const{getActiveMarker:t,getIsPremium:s,getShortcodesForParsing:r,getActiveAIFixesButton:a}=e("yoast-seo/editor");return{activeMarker:t(),isPremium:s(),shortcodesForParsing:r(),activeAIFixesButton:a()}})),(0,ge.withDispatch)((e=>{const{setActiveMarker:t,setMarkerPauseStatus:s,setActiveAIFixesButton:r}=e("yoast-seo/editor");return{setActiveMarker:t,setMarkerPauseStatus:s,setActiveAIFixesButton:r}}))])(Ye),Ge=window.yoast.relatedKeyphraseSuggestions;function Ze(e){const{requestLimitReached:t,isSuccess:s,response:r,requestHasData:a,relatedKeyphrases:n}=e;return t?"requestLimitReached":!s&&function(e){return"invalid_json"===(null==e?void 0:e.code)||"fetch_error"===(null==e?void 0:e.code)||!(0,l.isEmpty)(e)&&"error"in e}(r)?"requestFailed":a?function(e){return e&&e.length>=4}(n)?"maxRelatedKeyphrases":null:"requestEmpty"}function Qe(e){var t,s;const{keyphrase:r="",relatedKeyphrases:a=[],renderAction:n=null,requestLimitReached:o=!1,countryCode:i="us",setCountry:l,newRequest:c,response:d={},isRtl:u=!1,userLocale:p="en_US",isPending:m=!1,isPremium:h=!1,semrushUpsellLink:g="",premiumUpsellLink:y=""}=e,[f,w]=(0,v.useState)(i),E=(0,v.useCallback)((async()=>{c(i,r),w(i)}),[i,r,c]);return(0,b.createElement)(xe.Root,{context:{isRtl:u}},!o&&!h&&(0,b.createElement)(Ge.PremiumUpsell,{url:y,className:"yst-mb-4"}),!o&&(0,b.createElement)(Ge.CountrySelector,{countryCode:i,activeCountryCode:f,onChange:l,onClick:E,className:"yst-mb-4",userLocale:p.split("_")[0]}),!m&&(0,b.createElement)(Ge.UserMessage,{variant:Ze(e),upsellLink:g}),(0,b.createElement)(Ge.KeyphrasesTable,{relatedKeyphrases:a,columnNames:null==d||null===(t=d.results)||void 0===t?void 0:t.columnNames,data:null==d||null===(s=d.results)||void 0===s?void 0:s.rows,isPending:m,renderButton:n,className:"yst-mt-4"}))}Qe.propTypes={keyphrase:S().string,relatedKeyphrases:S().array,renderAction:S().func,requestLimitReached:S().bool,countryCode:S().string.isRequired,setCountry:S().func.isRequired,newRequest:S().func.isRequired,response:S().object,isRtl:S().bool,userLocale:S().string,isPending:S().bool,isPremium:S().bool,semrushUpsellLink:S().string,premiumUpsellLink:S().string};const Xe=(0,he.compose)([(0,ge.withSelect)((e=>{const{getFocusKeyphrase:t,getSEMrushSelectedCountry:s,getSEMrushRequestLimitReached:r,getSEMrushRequestResponse:a,getSEMrushRequestIsSuccess:n,getSEMrushIsRequestPending:o,getSEMrushRequestHasData:i,getSEMrushRequestKeyphrase:l,getPreference:c,getIsPremium:d,selectLinkParams:u}=e("yoast-seo/editor");return{keyphrase:t(),countryCode:s(),requestLimitReached:r(),response:a(),isSuccess:n(),isPending:o(),requestHasData:i(),lastRequestKeyphrase:l(),isRtl:c("isRtl",!1),userLocale:c("userLocale","en_US"),isPremium:d(),semrushUpsellLink:(0,Re.addQueryArgs)("https://yoa.st/semrush-prices",u()),premiumUpsellLink:(0,Re.addQueryArgs)("https://yoa.st/413",u())}})),(0,ge.withDispatch)((e=>{const{setSEMrushChangeCountry:t,setSEMrushNewRequest:s}=e("yoast-seo/editor");return{setCountry:e=>{t(e)},newRequest:(e,t)=>{s(e,t)}}}))])(Qe),Je=window.moment;var et=s.n(Je),tt=s(6746);const st=(0,C.makeOutboundLink)(),rt=e=>{const t=(0,d.sprintf)(/* translators: %1$d expands to the amount of allowed keyphrases on a free account, %2$s expands to a link to Wincher plans. */ (0,d.__)("You've reached the maximum amount of %1$d keyphrases you can add to your Wincher account. If you wish to add more keyphrases, please %2$s.","wordpress-seo"),e.limit,"{{updateWincherPlanLink/}}");return(0,b.createElement)(R.Alert,{type:"error"},(0,tt.Z)({mixedString:t,components:{updateWincherPlanLink:(0,b.createElement)(st,{href:wpseoAdminGlobalL10n["links.wincher.pricing"]},(0,d.sprintf)(/* translators: %s : Expands to "Wincher". */ (0,d.__)("upgrade your %s plan","wordpress-seo"),"Wincher"))}}))};rt.propTypes={limit:S().number},rt.defaultProps={limit:10};const at=rt,nt=()=>(0,b.createElement)(R.Alert,{type:"error"},(0,d.__)("Something went wrong while tracking the ranking position(s) of your page. Please try again later.","wordpress-seo")),ot=window.wp.apiFetch;var it=s.n(ot);async function lt(e,t,s,r=200){try{const a=await e();return!!a&&(a.status===r?t(a):s(a))}catch(e){console.error(e.message)}}async function ct(e){try{return await it()(e)}catch(e){return e.error&&e.status?e:e instanceof Response&&await e.json()}}async function dt(e){return(0,l.isArray)(e)||(e=[e]),await ct({path:"yoast/v1/wincher/keyphrases/track",method:"POST",data:{keyphrases:e}})}const ut=x().p` color: ${L.colors.$color_pink_dark}; font-size: 14px; font-weight: 700; margin: 13px 0 10px; `,pt=x()(R.SvgIcon)` margin-right: 5px; vertical-align: middle; `,mt=x().button` position: absolute; top: 9px; right: 9px; border: none; background: none; cursor: pointer; `,ht=x().p` font-size: 13px; font-weight: 500; margin: 10px 0 13px; `,gt=x().div` position: relative; background: ${e=>e.isTitleShortened?"#F5F7F7":"transparent"}; border: 1px solid #C7C7C7; border-left: 4px solid${L.colors.$color_pink_dark}; padding: 0 16px; margin-bottom: 1.5em; `,yt=e=>{const[t,s]=(0,v.useState)(null);return(0,v.useEffect)((()=>{e&&!t&&async function(){return await ct({path:"yoast/v1/wincher/account/limit",method:"GET"})}().then((e=>s(e)))}),[t]),t};yt.propTypes={limit:S().bool.isRequired};const ft=({limit:e,usage:t,isTitleShortened:s,isFreeAccount:r})=>{const a=(0,d.sprintf)( /* Translators: %1$s expands to the number of used keywords. * %2$s expands to the account keywords limit. */ (0,d.__)("Your are tracking %1$s out of %2$s keyphrases included in your free account.","wordpress-seo"),t,e),n=(0,d.sprintf)( /* Translators: %1$s expands to the number of used keywords. * %2$s expands to the account keywords limit. */ (0,d.__)("Your are tracking %1$s out of %2$s keyphrases included in your account.","wordpress-seo"),t,e),o=r?a:n,i=(0,d.sprintf)( /* Translators: %1$s expands to the number of used keywords. * %2$s expands to the account keywords limit. */ (0,d.__)("Keyphrases tracked: %1$s/%2$s","wordpress-seo"),t,e),l=s?i:o;return(0,b.createElement)(ut,null,s&&(0,b.createElement)(pt,{icon:"exclamation-triangle",color:L.colors.$color_pink_dark,size:"14px"}),l)};ft.propTypes={limit:S().number.isRequired,usage:S().number.isRequired,isTitleShortened:S().bool,isFreeAccount:S().bool};const wt=(0,C.makeOutboundLink)(),bt=({discount:e,months:t})=>{const s=(0,b.createElement)(wt,{href:wpseoAdminGlobalL10n["links.wincher.upgrade"],style:{fontWeight:600}},(0,d.sprintf)(/* Translators: %s : Expands to "Wincher". */ (0,d.__)("Click here to upgrade your %s plan","wordpress-seo"),"Wincher"));if(!e||!t)return(0,b.createElement)(ht,null,s);const r=100*e,a=(0,d.sprintf)( /* Translators: %1$s expands to upgrade account link. * %2$s expands to the upgrade discount value. * %3$s expands to the upgrade discount duration e.g. 2 months. */ (0,d.__)("%1$s and get an exclusive %2$s discount for %3$s month(s).","wordpress-seo"),"{{wincherAccountUpgradeLink/}}",r+"%",t);return(0,b.createElement)(ht,null,(0,tt.Z)({mixedString:a,components:{wincherAccountUpgradeLink:s}}))};bt.propTypes={discount:S().number,months:S().number};const Et=({onClose:e,isTitleShortened:t,trackingInfo:s})=>{const r=(()=>{const[e,t]=(0,v.useState)(null);return(0,v.useEffect)((()=>{e||async function(){return await ct({path:"yoast/v1/wincher/account/upgrade-campaign",method:"GET"})}().then((e=>t(e)))}),[e]),e})();if(null===s)return null;const{limit:a,usage:n}=s;if(!(a&&n/a>=.8))return null;const o=Boolean(null==r?void 0:r.discount);return(0,b.createElement)(gt,{isTitleShortened:t},e&&(0,b.createElement)(mt,{type:"button","aria-label":(0,d.__)("Close the upgrade callout","wordpress-seo"),onClick:e},(0,b.createElement)(R.SvgIcon,{icon:"times-circle",color:L.colors.$color_pink_dark,size:"14px"})),(0,b.createElement)(ft,{...s,isTitleShortened:t,isFreeAccount:o}),(0,b.createElement)(bt,{discount:null==r?void 0:r.discount,months:null==r?void 0:r.months}))};Et.propTypes={onClose:S().func,isTitleShortened:S().bool,trackingInfo:S().object};const vt=Et,kt=()=>(0,b.createElement)(R.Alert,{type:"success"},(0,d.sprintf)(/* translators: %s: Expands to "Wincher". */ (0,d.__)("You have successfully connected to %s! You can now track the SEO performance for the keyphrase(s) of this page.","wordpress-seo"),"Wincher")),xt=()=>(0,b.createElement)(R.Alert,{type:"info"},(0,d.sprintf)(/* translators: %s: Expands to "Wincher". */ (0,d.__)("%s is currently tracking the ranking position(s) of your page. This may take a few minutes. Please wait or check back later.","wordpress-seo"),"Wincher")),_t=({data:e,mapChartDataToTableData:t,dataTableCaption:s,dataTableHeaderLabels:r,isDataTableVisuallyHidden:a})=>e.length!==r.length?(0,b.createElement)("p",null,(0,d.__)("The number of headers and header labels don't match.","wordpress-seo")):(0,b.createElement)("div",{className:a?"screen-reader-text":null},(0,b.createElement)("table",null,(0,b.createElement)("caption",null,s),(0,b.createElement)("thead",null,(0,b.createElement)("tr",null,r.map(((e,t)=>(0,b.createElement)("th",{key:t},e))))),(0,b.createElement)("tbody",null,(0,b.createElement)("tr",null,e.map(((e,s)=>(0,b.createElement)("td",{key:s},t(e.y))))))));_t.propTypes={data:S().arrayOf(S().shape({x:S().number,y:S().number})).isRequired,mapChartDataToTableData:S().func,dataTableCaption:S().string.isRequired,dataTableHeaderLabels:S().array.isRequired,isDataTableVisuallyHidden:S().bool},_t.defaultProps={mapChartDataToTableData:null,isDataTableVisuallyHidden:!0};const St=_t,Rt=({data:e,width:t,height:s,fillColor:r,strokeColor:a,strokeWidth:n,className:o,mapChartDataToTableData:i,dataTableCaption:l,dataTableHeaderLabels:c,isDataTableVisuallyHidden:d})=>{const u=Math.max(1,Math.max(...e.map((e=>e.x)))),p=Math.max(1,Math.max(...e.map((e=>e.y)))),m=s-n,h=e.map((e=>`${e.x/u*t},${m-e.y/p*m+n}`)).join(" "),g=`0,${m+n} `+h+` ${t},${m+n}`;return(0,b.createElement)(v.Fragment,null,(0,b.createElement)("svg",{width:t,height:s,viewBox:`0 0 ${t} ${s}`,className:o,role:"img","aria-hidden":"true",focusable:"false"},(0,b.createElement)("polygon",{fill:r,points:g}),(0,b.createElement)("polyline",{fill:"none",stroke:a,strokeWidth:n,strokeLinejoin:"round",strokeLinecap:"round",points:h})),i&&(0,b.createElement)(St,{data:e,mapChartDataToTableData:i,dataTableCaption:l,dataTableHeaderLabels:c,isDataTableVisuallyHidden:d}))};Rt.propTypes={data:S().arrayOf(S().shape({x:S().number,y:S().number})).isRequired,width:S().number.isRequired,height:S().number.isRequired,fillColor:S().string,strokeColor:S().string,strokeWidth:S().number,className:S().string,mapChartDataToTableData:S().func,dataTableCaption:S().string.isRequired,dataTableHeaderLabels:S().array.isRequired,isDataTableVisuallyHidden:S().bool},Rt.defaultProps={fillColor:null,strokeColor:"#000000",strokeWidth:1,className:"",mapChartDataToTableData:null,isDataTableVisuallyHidden:!0};const Ct=Rt,Lt=()=>(0,b.createElement)("p",{className:"yoast-wincher-seo-performance-modal__loading-message"},(0,d.__)("Tracking the ranking position…","wordpress-seo")," ",(0,b.createElement)(R.SvgIcon,{icon:"loading-spinner"})),It=x()(R.SvgIcon)` margin-left: 2px; flex-shrink: 0; rotate: ${e=>e.isImproving?"-90deg":"90deg"}; `,Tt=x().span` color: ${e=>e.isImproving?"#69AB56":"#DC3332"}; font-size: 13px; font-weight: 600; line-height: 20px; margin-right: 2px; margin-left: 12px; `,Nt=x().td` padding-right: 0 !important; & > div { margin: 0px; } `,Pt=x().td` padding-left: 2px !important; `,Mt=x().td.attrs({className:"yoast-table--nopadding"})` & > div { justify-content: center; } `,At=x().div` display: flex; align-items: center; & > a { box-sizing: border-box; } `,Ot=x().button` background: none; color: inherit; border: none; padding: 0; font: inherit; cursor: pointer; outline: inherit; display: flex; align-items: center; `,Ft=x().tr` background-color: ${e=>e.isEnabled?"#FFFFFF":"#F9F9F9"} !important; `;function qt(e){return Math.round(100*e)}function $t({chartData:e}){if((0,l.isEmpty)(e)||(0,l.isEmpty)(e.position))return"?";const t=function(e){return Array.from({length:e.position.history.length},((e,t)=>t+1)).map((e=>(0,d.sprintf)((0,d._n)("%d day","%d days",e,"wordpress-seo"),e)))}(e),s=e.position.history.map(((e,t)=>({x:t,y:101-e.value})));return(0,b.createElement)(Ct,{width:66,height:24,data:s,strokeWidth:1.8,strokeColor:"#498afc",fillColor:"#ade3fc",mapChartDataToTableData:qt,dataTableCaption:(0,d.__)("Keyphrase position in the last 90 days on a scale from 0 to 100.","wordpress-seo"),dataTableHeaderLabels:t})}$t.propTypes={chartData:S().object},$t.defaultProps={chartData:{}};const Bt=({rowData:e})=>{var t;if(null==e||null===(t=e.position)||void 0===t||!t.change)return(0,b.createElement)($t,{chartData:e});const s=e.position.change<0;return(0,b.createElement)(v.Fragment,null,(0,b.createElement)($t,{chartData:e}),(0,b.createElement)(Tt,{isImproving:s},Math.abs(e.position.change)),(0,b.createElement)(It,{icon:"caret-right",color:s?"#69AB56":"#DC3332",size:"14px",isImproving:s}))};function Dt(e){var t;const{keyphrase:s,rowData:r,onTrackKeyphrase:a,onUntrackKeyphrase:n,isFocusKeyphrase:o,isDisabled:i,isLoading:c,isSelected:u,onSelectKeyphrases:p}=e,m=!(0,l.isEmpty)(r),h=!(0,l.isEmpty)(null==r||null===(t=r.position)||void 0===t?void 0:t.history),g=(0,v.useCallback)((()=>{i||(m?n(s,r.id):a(s))}),[s,a,n,m,r,i]),y=(0,v.useCallback)((()=>{p((e=>u?e.filter((e=>e!==s)):e.concat(s)))}),[p,u,s]);return(0,b.createElement)(Ft,{isEnabled:m},(0,b.createElement)(Nt,null,h&&(0,b.createElement)(R.Checkbox,{id:"select-"+s,onChange:y,checked:u,label:""})),(0,b.createElement)(Pt,null,s,o&&(0,b.createElement)("span",null,"*")),function(e){const{rowData:t,websiteId:s,keyphrase:r,onSelectKeyphrases:a}=e,n=(0,v.useCallback)((()=>{a([r])}),[a,r]),o=!(0,l.isEmpty)(t),i=t&&t.updated_at&&et()(t.updated_at)>=et()().subtract(7,"days"),c=t?`https://app.wincher.com/websites/${s}/keywords?serp=${t.id}&utm_medium=plugin&utm_source=yoast&referer=yoast&partner=yoast`:null;return o?i?(0,b.createElement)(v.Fragment,null,(0,b.createElement)("td",null,(0,b.createElement)(At,null,function(e){return!e||!e.position||e.position.value>100?"> 100":e.position.value}(t),(0,b.createElement)(R.ButtonStyledLink,{variant:"secondary",href:c,style:{height:28,marginLeft:12},rel:"noopener",target:"_blank"},(0,d.__)("View","wordpress-seo")))),(0,b.createElement)("td",{className:"yoast-table--nopadding"},(0,b.createElement)(Ot,{type:"button",onClick:n},(0,b.createElement)(Bt,{rowData:t}))),(0,b.createElement)("td",null,(u=t.updated_at,et()(u).fromNow()))):(0,b.createElement)("td",{className:"yoast-table--nopadding",colSpan:"3"},(0,b.createElement)(Lt,null)):(0,b.createElement)("td",{className:"yoast-table--nopadding",colSpan:"3"},(0,b.createElement)("i",null,(0,d.__)("Activate tracking to show the ranking position","wordpress-seo")));var u}(e),(0,b.createElement)(Mt,null,function({keyphrase:e,isEnabled:t,toggleAction:s,isLoading:r}){return r?(0,b.createElement)(R.SvgIcon,{icon:"loading-spinner"}):(0,b.createElement)(R.Toggle,{id:`toggle-keyphrase-tracking-${e}`,className:"wincher-toggle",isEnabled:t,onSetToggleState:s,showToggleStateLabel:!1})}({keyphrase:s,isEnabled:m,toggleAction:g,isLoading:c})))}Bt.propTypes={rowData:S().object},Dt.propTypes={rowData:S().object,keyphrase:S().string.isRequired,onTrackKeyphrase:S().func,onUntrackKeyphrase:S().func,isFocusKeyphrase:S().bool,isDisabled:S().bool,isLoading:S().bool,websiteId:S().string,isSelected:S().bool.isRequired,onSelectKeyphrases:S().func.isRequired},Dt.defaultProps={rowData:{},onTrackKeyphrase:()=>{},onUntrackKeyphrase:()=>{},isFocusKeyphrase:!1,isDisabled:!1,isLoading:!1,websiteId:""};const Wt=(0,C.makeOutboundLink)(),Ut=x().span` display: block; font-style: italic; @media (min-width: 782px) { display: inline; position: absolute; ${(0,C.getDirectionalStyle)("right","left")}: 8px; } `,Ht=x().div` width: 100%; overflow-y: auto; `,jt=x().th` pointer-events: ${e=>e.isDisabled?"none":"initial"}; padding-right: 0 !important; & > div { margin: 0px; } `,Kt=x().th` padding-left: 2px !important; `,zt=e=>{const t=(0,v.useRef)();return(0,v.useEffect)((()=>{t.current=e})),t.current},Yt=(0,l.debounce)((async function(e=null,t=null,s=null,r){return await ct({path:"yoast/v1/wincher/keyphrases",method:"POST",data:{keyphrases:e,permalink:s,startAt:t},signal:r})}),500,{leading:!0}),Vt=e=>{const{addTrackedKeyphrase:t,isLoggedIn:s,keyphrases:r,permalink:a,removeTrackedKeyphrase:n,setKeyphraseLimitReached:o,setRequestFailed:i,setRequestSucceeded:c,setTrackedKeyphrases:u,setHasTrackedAll:p,trackAll:m,trackedKeyphrases:h,isNewlyAuthenticated:g,websiteId:y,focusKeyphrase:f,newRequest:w,startAt:E,selectedKeyphrases:k,onSelectKeyphrases:x}=e,_=(0,v.useRef)(),S=(0,v.useRef)(),C=(0,v.useRef)(!1),[L,I]=(0,v.useState)([]),T=(0,v.useCallback)((e=>{const t=e.toLowerCase();return h&&!(0,l.isEmpty)(h)&&h.hasOwnProperty(t)?h[t]:null}),[h]),N=(0,v.useMemo)((()=>async()=>{await lt((()=>(S.current&&S.current.abort(),S.current="undefined"==typeof AbortController?null:new AbortController,Yt(r,E,a,S.current.signal))),(e=>{c(e),u(e.results)}),(e=>{i(e)}))}),[c,i,u,r,a,E]),P=(0,v.useCallback)((async e=>{const s=(Array.isArray(e)?e:[e]).map((e=>e.toLowerCase()));I((e=>[...e,...s])),await lt((()=>dt(s)),(e=>{c(e),t(e.results),N()}),(e=>{400===e.status&&e.limit&&o(e.limit),i(e)}),201),I((e=>(0,l.without)(e,...s)))}),[c,i,o,t,N]),M=(0,v.useCallback)((async(e,t)=>{e=e.toLowerCase(),I((t=>[...t,e])),await lt((()=>async function(e){return await ct({path:"yoast/v1/wincher/keyphrases/untrack",method:"DELETE",data:{keyphraseID:e}})}(t)),(t=>{c(t),n(e)}),(e=>{i(e)})),I((t=>(0,l.without)(t,e)))}),[c,n,i]),A=(0,v.useCallback)((async e=>{w(),await P(e)}),[w,P]),O=zt(a),F=zt(r),q=zt(E),$=a&&E;(0,v.useEffect)((()=>{s&&$&&(a!==O||(0,l.difference)(r,F).length||E!==q)&&N()}),[s,a,O,r,F,N,$,E,q]),(0,v.useEffect)((()=>{if(s&&m&&null!==h){const e=r.filter((e=>!T(e)));e.length&&P(e),p()}}),[s,m,h,P,p,T,r]),(0,v.useEffect)((()=>{g&&!C.current&&(N(),C.current=!0)}),[g,N]),(0,v.useEffect)((()=>{if(s&&!(0,l.isEmpty)(h))return(0,l.filter)(h,(e=>(0,l.isEmpty)(e.updated_at))).length>0&&(_.current=setInterval((()=>{N()}),1e4)),()=>{clearInterval(_.current)}}),[s,h,N]);const B=s&&null===h,D=(0,v.useMemo)((()=>(0,l.isEmpty)(h)?[]:Object.values(h).filter((e=>{var t;return!(0,l.isEmpty)(null==e||null===(t=e.position)||void 0===t?void 0:t.history)})).map((e=>e.keyword))),[h]),W=(0,v.useMemo)((()=>k.length>0&&D.length>0&&D.every((e=>k.includes(e)))),[k,D]),U=(0,v.useCallback)((()=>{x(W?[]:D)}),[x,W,D]),H=(0,v.useMemo)((()=>(0,l.orderBy)(r,[e=>Object.values(h||{}).map((e=>e.keyword)).includes(e)],["desc"])),[r,h]);return r&&!(0,l.isEmpty)(r)&&(0,b.createElement)(v.Fragment,null,(0,b.createElement)(Ht,null,(0,b.createElement)("table",{className:"yoast yoast-table"},(0,b.createElement)("thead",null,(0,b.createElement)("tr",null,(0,b.createElement)(jt,{isDisabled:0===D.length},(0,b.createElement)(R.Checkbox,{id:"select-all",onChange:U,checked:W,label:""})),(0,b.createElement)(Kt,{scope:"col",abbr:(0,d.__)("Keyphrase","wordpress-seo")},(0,d.__)("Keyphrase","wordpress-seo")),(0,b.createElement)("th",{scope:"col",abbr:(0,d.__)("Position","wordpress-seo")},(0,d.__)("Position","wordpress-seo")),(0,b.createElement)("th",{scope:"col",abbr:(0,d.__)("Position over time","wordpress-seo")},(0,d.__)("Position over time","wordpress-seo")),(0,b.createElement)("th",{scope:"col",abbr:(0,d.__)("Last updated","wordpress-seo")},(0,d.__)("Last updated","wordpress-seo")),(0,b.createElement)("th",{scope:"col",abbr:(0,d.__)("Tracking","wordpress-seo")},(0,d.__)("Tracking","wordpress-seo")))),(0,b.createElement)("tbody",null,H.map(((e,t)=>(0,b.createElement)(Dt,{key:`trackable-keyphrase-${t}`,keyphrase:e,onTrackKeyphrase:A,onUntrackKeyphrase:M,rowData:T(e),isFocusKeyphrase:e===f.trim().toLowerCase(),websiteId:y,isDisabled:!s,isLoading:B||L.indexOf(e.toLowerCase())>=0,isSelected:k.includes(e),onSelectKeyphrases:x})))))),(0,b.createElement)("p",{style:{marginBottom:0,position:"relative"}},(0,b.createElement)(Wt,{href:wpseoAdminGlobalL10n["links.wincher.login"]},(0,d.sprintf)(/* translators: %s expands to Wincher */ (0,d.__)("Get more insights over at %s","wordpress-seo"),"Wincher")),(0,b.createElement)(Ut,null,(0,d.__)("* focus keyphrase","wordpress-seo"))))};Vt.propTypes={addTrackedKeyphrase:S().func.isRequired,isLoggedIn:S().bool,isNewlyAuthenticated:S().bool,keyphrases:S().array,newRequest:S().func.isRequired,removeTrackedKeyphrase:S().func.isRequired,setRequestFailed:S().func.isRequired,setKeyphraseLimitReached:S().func.isRequired,setRequestSucceeded:S().func.isRequired,setTrackedKeyphrases:S().func.isRequired,setHasTrackedAll:S().func.isRequired,trackAll:S().bool,trackedKeyphrases:S().object,websiteId:S().string,permalink:S().string.isRequired,focusKeyphrase:S().string,startAt:S().string,selectedKeyphrases:S().arrayOf(S().string).isRequired,onSelectKeyphrases:S().func.isRequired},Vt.defaultProps={isLoggedIn:!1,isNewlyAuthenticated:!1,keyphrases:[],trackAll:!1,websiteId:"",focusKeyphrase:""};const Gt=Vt,Zt=(0,he.compose)([(0,ge.withSelect)((e=>{const{getWincherWebsiteId:t,getWincherTrackableKeyphrases:s,getWincherLoginStatus:r,getWincherPermalink:a,getFocusKeyphrase:n,isWincherNewlyAuthenticated:o,shouldWincherTrackAll:i}=e("yoast-seo/editor");return{focusKeyphrase:n(),keyphrases:s(),isLoggedIn:r(),trackAll:i(),websiteId:t(),isNewlyAuthenticated:o(),permalink:a()}})),(0,ge.withDispatch)((e=>{const{setWincherNewRequest:t,setWincherRequestSucceeded:s,setWincherRequestFailed:r,setWincherSetKeyphraseLimitReached:a,setWincherTrackedKeyphrases:n,setWincherTrackingForKeyphrase:o,setWincherTrackAllKeyphrases:i,unsetWincherTrackingForKeyphrase:l}=e("yoast-seo/editor");return{newRequest:()=>{t()},setRequestSucceeded:e=>{s(e)},setRequestFailed:e=>{r(e)},setKeyphraseLimitReached:e=>{a(e)},addTrackedKeyphrase:e=>{o(e)},removeTrackedKeyphrase:e=>{l(e)},setTrackedKeyphrases:e=>{n(e)},setHasTrackedAll:()=>{i(!1)}}}))])(Gt),Qt=(0,C.makeOutboundLink)(),Xt=(0,C.makeOutboundLink)(),Jt=()=>{const e=(0,d.sprintf)(/* translators: %1$s expands to a link to Wincher, %2$s expands to a link to the keyphrase tracking article on Yoast.com */ (0,d.__)("With %1$s you can track the ranking position of your page in the search results based on your keyphrase(s). %2$s","wordpress-seo"),"{{wincherLink/}}","{{wincherReadMoreLink/}}");return(0,b.createElement)("p",null,(0,tt.Z)({mixedString:e,components:{wincherLink:(0,b.createElement)(Qt,{href:wpseoAdminGlobalL10n["links.wincher.website"]},"Wincher"),wincherReadMoreLink:(0,b.createElement)(Xt,{href:wpseoAdminL10n["shortlinks.wincher.seo_performance"]},(0,d.__)("Read more about keyphrase tracking with Wincher","wordpress-seo"))}}))},es=()=>(0,b.createElement)(R.Alert,{type:"error"},(0,d.__)("No keyphrase has been set. Please set a keyphrase first.","wordpress-seo")),ts=()=>(0,b.createElement)(R.Alert,{type:"info"},(0,d.sprintf)(/* translators: %s: Expands to "Wincher". */ (0,d.__)("Automatic tracking of keyphrases is enabled. Your keyphrase(s) will automatically be tracked by %s when you publish your post.","wordpress-seo"),"Wincher"));class ss{constructor(e,t={},s={}){this.url=e,this.origin=new URL(e).origin,this.eventHandlers=Object.assign({success:{type:"",callback:()=>{}},error:{type:"",callback:()=>{}}},t),this.options=Object.assign({height:570,width:340,title:""},s),this.popup=null,this.createPopup=this.createPopup.bind(this),this.messageHandler=this.messageHandler.bind(this),this.getPopup=this.getPopup.bind(this)}createPopup(){const{height:e,width:t,title:s}=this.options,r=["top="+(window.top.outerHeight/2+window.top.screenY-e/2),"left="+(window.top.outerWidth/2+window.top.screenX-t/2),"width="+t,"height="+e,"resizable=1","scrollbars=1","status=0"];this.popup&&!this.popup.closed||(this.popup=window.open(this.url,s,r.join(","))),this.popup&&this.popup.focus(),window.addEventListener("message",this.messageHandler,!1)}async messageHandler(e){const{data:t,source:s,origin:r}=e;r===this.origin&&this.popup===s&&(t.type===this.eventHandlers.success.type&&(this.popup.close(),window.removeEventListener("message",this.messageHandler,!1),await this.eventHandlers.success.callback(t)),t.type===this.eventHandlers.error.type&&(this.popup.close(),window.removeEventListener("message",this.messageHandler,!1),await this.eventHandlers.error.callback(t)))}getPopup(){return this.popup}isClosed(){return!this.popup||this.popup.closed}focus(){this.isClosed()||this.popup.focus()}}const rs=e=>{const t=(0,d.sprintf)(/* translators: %s expands to a link to open the Wincher login popup. */ (0,d.__)("It seems like something went wrong when retrieving your website's data. Please %s and try again.","wordpress-seo"),"{{reconnectToWincher/}}","Wincher");return(0,b.createElement)(R.Alert,{type:"error",className:e.className},(0,tt.Z)({mixedString:t,components:{reconnectToWincher:(0,b.createElement)("a",{href:"#",onClick:t=>{t.preventDefault(),e.onReconnect()}},(0,d.sprintf)(/* translators: %s : Expands to "Wincher". */ (0,d.__)("reconnect to %s","wordpress-seo"),"Wincher"))}}))};rs.propTypes={onReconnect:S().func.isRequired,className:S().string},rs.defaultProps={className:""};const as=rs,ns=()=>(0,b.createElement)(R.Alert,{type:"error"},(0,d.__)("Before you can track your SEO performance make sure to set either the post’s title and save it as a draft or manually set the post’s slug.","wordpress-seo")),os=window.yoast["chart.js"],is="label";function ls(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function cs(e,t){e.labels=t}function ds(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:is;const r=[];e.datasets=t.map((t=>{const a=e.datasets.find((e=>e[s]===t[s]));return a&&t.data&&!r.includes(a)?(r.push(a),Object.assign(a,t),a):{...t}}))}function us(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:is;const s={labels:[],datasets:[]};return cs(s,e.labels),ds(s,e.datasets,t),s}function ps(e,t){const{height:s=150,width:r=300,redraw:a=!1,datasetIdKey:n,type:o,data:i,options:l,plugins:c=[],fallbackContent:d,updateMode:u,...p}=e,m=(0,b.useRef)(null),h=(0,b.useRef)(),g=()=>{m.current&&(h.current=new os.Chart(m.current,{type:o,data:us(i,n),options:l&&{...l},plugins:c}),ls(t,h.current))},y=()=>{ls(t,null),h.current&&(h.current.destroy(),h.current=null)};return(0,b.useEffect)((()=>{!a&&h.current&&l&&function(e,t){const s=e.options;s&&t&&Object.assign(s,t)}(h.current,l)}),[a,l]),(0,b.useEffect)((()=>{!a&&h.current&&cs(h.current.config.data,i.labels)}),[a,i.labels]),(0,b.useEffect)((()=>{!a&&h.current&&i.datasets&&ds(h.current.config.data,i.datasets,n)}),[a,i.datasets]),(0,b.useEffect)((()=>{h.current&&(a?(y(),setTimeout(g)):h.current.update(u))}),[a,l,i.labels,i.datasets,u]),(0,b.useEffect)((()=>{h.current&&(y(),setTimeout(g))}),[o]),(0,b.useEffect)((()=>(g(),()=>y())),[]),b.createElement("canvas",Object.assign({ref:m,role:"img",height:s,width:r},p),d)}const ms=(0,b.forwardRef)(ps);function hs(e,t){return os.Chart.register(t),(0,b.forwardRef)(((t,s)=>b.createElement(ms,Object.assign({},t,{ref:s,type:e}))))}const gs=hs("line",os.LineController),ys={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};os._adapters._date.override("function"==typeof et()?{_id:"moment",formats:function(){return ys},parse:function(e,t){return"string"==typeof e&&"string"==typeof t?e=et()(e,t):e instanceof et()||(e=et()(e)),e.isValid()?e.valueOf():null},format:function(e,t){return et()(e).format(t)},add:function(e,t,s){return et()(e).add(t,s).valueOf()},diff:function(e,t,s){return et()(e).diff(et()(t),s)},startOf:function(e,t,s){return e=et()(e),"isoWeek"===t?(s=Math.trunc(Math.min(Math.max(0,s),6)),e.isoWeekday(s).startOf("day").valueOf()):e.startOf(t).valueOf()},endOf:function(e,t){return et()(e).endOf(t).valueOf()}}:{}),Math.PI,Number.POSITIVE_INFINITY,Math.log10,Math.sign,"undefined"==typeof window||window.requestAnimationFrame,new Map,Object.create(null),Object.create(null),Number.EPSILON;const fs=["top","right","bottom","left"];function ws(e,t,s){const r={};s=s?"-"+s:"";for(let a=0;a<4;a++){const n=fs[a];r[n]=parseFloat(e[t+"-"+n+s])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}!function(){let e=!1;try{const t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}}(),os.Chart.register(os.CategoryScale,os.LineController,os.LineElement,os.PointElement,os.LinearScale,os.TimeScale,os.Legend,os.Tooltip);const bs=["#ff983b","#ffa3f7","#3798ff","#ff3b3b","#acce81","#b51751","#3949ab","#26c6da","#ccb800","#de66ff","#4db6ac","#ffab91","#45f5f1","#77f210","#90a4ae","#ffd54f","#006b5e","#8ec7d2","#b1887c","#cc9300"];function Es({datasets:e,isChartShown:t,keyphrases:s}){if(!t)return null;const r=(0,v.useMemo)((()=>Object.fromEntries([...s].sort().map(((e,t)=>[e,bs[t%bs.length]])))),[s]),a=e.map((e=>{const t=r[e.label];return{...e,data:e.data.map((({datetime:e,value:t})=>({x:e,y:t}))),lineTension:0,pointRadius:1,pointHoverRadius:4,borderWidth:2,pointHitRadius:6,backgroundColor:t,borderColor:t}})).filter((e=>!1!==e.selected));return(0,b.createElement)(gs,{height:100,data:{datasets:a},options:{plugins:{legend:{display:!0,position:"bottom",labels:{color:"black",usePointStyle:!0,boxHeight:7,boxWidth:7},onClick:l.noop},tooltip:{enabled:!0,callbacks:{title:e=>et()(e[0].raw.x).utc().format("YYYY-MM-DD")},titleAlign:"center",mode:"xPoint",position:"nearest",usePointStyle:!0,boxHeight:7,boxWidth:7,boxPadding:2}},scales:{x:{bounds:"ticks",type:"time",time:{unit:"day",minUnit:"day"},grid:{display:!1},ticks:{autoSkipPadding:50,maxRotation:0,color:"black"}},y:{bounds:"ticks",offset:!0,reverse:!0,ticks:{precision:0,color:"black"},max:101}}}})}os.Interaction.modes.xPoint=(e,t,s,r)=>{const a=function(e,t){if("native"in e)return e;const{canvas:s,currentDevicePixelRatio:r}=t,a=(m=s).ownerDocument.defaultView.getComputedStyle(m,null),n="border-box"===a.boxSizing,o=ws(a,"padding"),i=ws(a,"border","width"),{x:l,y:c,box:d}=function(e,t){const s=e.touches,r=s&&s.length?s[0]:e,{offsetX:a,offsetY:n}=r;let o,i,l=!1;if(((e,t,s)=>(e>0||t>0)&&(!s||!s.shadowRoot))(a,n,e.target))o=a,i=n;else{const e=t.getBoundingClientRect();o=r.clientX-e.left,i=r.clientY-e.top,l=!0}return{x:o,y:i,box:l}}(e,s),u=o.left+(d&&i.left),p=o.top+(d&&i.top);var m;let{width:h,height:g}=t;return n&&(h-=o.width+i.width,g-=o.height+i.height),{x:Math.round((l-u)/h*s.width/r),y:Math.round((c-p)/g*s.height/r)}}(t,e);let n=[];if(os.Interaction.evaluateInteractionItems(e,"x",a,((e,t,s)=>{e.inXRange(a.x,r)&&n.push({element:e,datasetIndex:t,index:s})})),0===n.length)return n;const o=n.reduce(((e,t)=>Math.abs(a.x-e.element.x)<Math.abs(a.x-t.element.x)?e:t)).element.x;return n=n.filter((e=>e.element.x===o)),n.some((e=>Math.abs(e.element.y-a.y)<10))?n:[]},Es.propTypes={datasets:S().arrayOf(S().shape({label:S().string.isRequired,data:S().arrayOf(S().shape({datetime:S().string.isRequired,value:S().number.isRequired})).isRequired,selected:S().bool})).isRequired,isChartShown:S().bool.isRequired,keyphrases:S().array.isRequired};const vs=({response:e,onLogin:t})=>[401,403,404].includes(e.status)?(0,b.createElement)(as,{onReconnect:t}):(0,b.createElement)(nt,null);vs.propTypes={response:S().object.isRequired,onLogin:S().func.isRequired};const ks=({isSuccess:e,response:t,allKeyphrasesMissRanking:s,onLogin:r,keyphraseLimitReached:a,limit:n})=>a?(0,b.createElement)(at,{limit:n}):(0,l.isEmpty)(t)||e?s?(0,b.createElement)(xt,null):null:(0,b.createElement)(vs,{response:t,onLogin:r});ks.propTypes={isSuccess:S().bool.isRequired,allKeyphrasesMissRanking:S().bool.isRequired,response:S().object,onLogin:S().func.isRequired,keyphraseLimitReached:S().bool.isRequired,limit:S().number.isRequired},ks.defaultProps={response:{}};let xs=null;const _s=async e=>{if(xs&&!xs.isClosed())return void xs.focus();const{url:t}=await async function(){return await ct({path:"yoast/v1/wincher/authorization-url",method:"GET"})}();xs=new ss(t,{success:{type:"wincher:oauth:success",callback:t=>(async(e,t)=>{const{onAuthentication:s,setRequestSucceeded:r,setRequestFailed:a,keyphrases:n,addTrackedKeyphrase:o,setKeyphraseLimitReached:i}=e;await lt((()=>async function(e){const{code:t,websiteId:s}=e;return await ct({path:"yoast/v1/wincher/authenticate",method:"POST",data:{code:t,websiteId:s}})}(t)),(async e=>{s(!0,!0,t.websiteId.toString()),r(e);const l=(Array.isArray(n)?n:[n]).map((e=>e.toLowerCase()));await lt((()=>dt(l)),(e=>{r(e),o(e.results)}),(e=>{400===e.status&&e.limit&&i(e.limit),a(e)}),201);const c=xs.getPopup();c&&c.close()}),(async e=>a(e)))})(e,t)},error:{type:"wincher:oauth:error",callback:()=>e.onAuthentication(!1,!1)}},{title:"Wincher_login",width:500,height:700}),xs.createPopup()},Ss=e=>e.isLoggedIn?null:(0,b.createElement)("p",null,(0,b.createElement)(R.NewButton,{onClick:e.onLogin,variant:"primary"},(0,d.sprintf)(/* translators: %s expands to Wincher */ (0,d.__)("Connect with %s","wordpress-seo"),"Wincher")));Ss.propTypes={isLoggedIn:S().bool.isRequired,onLogin:S().func.isRequired};const Rs=x().div` p { margin: 1em 0; } `,Cs=x().div` ${e=>e.isDisabled&&"\n\t\topacity: .5;\n\t\tpointer-events: none;\n\t"}; `,Ls=x().div` font-weight: var(--yoast-font-weight-bold); color: var(--yoast-color-label); font-size: var(--yoast-font-size-default); `,Is=x().div.attrs({className:"yoast-field-group"})` display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; `,Ts=x().div` margin: 8px 0; `,Ns=et().utc().startOf("day"),Ps=[{name:(0,d.__)("Last day","wordpress-seo"),value:et()(Ns).subtract(1,"days").format(),defaultIndex:1},{name:(0,d.__)("Last week","wordpress-seo"),value:et()(Ns).subtract(1,"week").format(),defaultIndex:2},{name:(0,d.__)("Last month","wordpress-seo"),value:et()(Ns).subtract(1,"month").format(),defaultIndex:3},{name:(0,d.__)("Last year","wordpress-seo"),value:et()(Ns).subtract(1,"year").format(),defaultIndex:0}],Ms=e=>{const{onSelect:t,selected:s,options:r,isLoggedIn:a}=e;return a?r.length<1?null:(0,b.createElement)("select",{className:"components-select-control__input",id:"wincher-period-picker",value:(null==s?void 0:s.value)||r[0].value,onChange:t},r.map((e=>(0,b.createElement)("option",{key:e.name,value:e.value},e.name)))):null};Ms.propTypes={onSelect:S().func.isRequired,selected:S().object,options:S().array.isRequired,isLoggedIn:S().bool.isRequired};const As=e=>{const{trackedKeyphrases:t,isLoggedIn:s,keyphrases:r,shouldTrackAll:a,permalink:n,historyDaysLimit:o}=e;if(!n&&s)return(0,b.createElement)(ns,null);if(0===r.length)return(0,b.createElement)(es,null);const i=et()(Ns).subtract(o,"days"),c=Ps.filter((e=>et()(e.value).isSameOrAfter(i))),u=(0,l.orderBy)(c,(e=>e.defaultIndex),"desc")[0],[p,m]=(0,v.useState)(u),[h,g]=(0,v.useState)([]),y=h.length>0,f=(0,he.usePrevious)(t);(0,v.useEffect)((()=>{if(!(0,l.isEmpty)(t)&&(0,l.difference)(Object.keys(t),Object.keys(f||[])).length){const e=Object.values(t).map((e=>e.keyword));g(e)}}),[t,f]),(0,v.useEffect)((()=>{m(u)}),[null==u?void 0:u.name]);const w=(0,v.useCallback)((e=>{const t=Ps.find((t=>t.value===e.target.value));t&&m(t)}),[m]),E=(0,v.useMemo)((()=>(0,l.isEmpty)(h)||(0,l.isEmpty)(t)?[]:Object.values(t).filter((e=>{var t;return!(null==e||null===(t=e.position)||void 0===t||!t.history)})).map((e=>{var t;return{label:e.keyword,data:e.position.history,selected:h.includes(e.keyword)&&!(0,l.isEmpty)(null===(t=e.position)||void 0===t?void 0:t.history)}}))),[h,t]);return(0,b.createElement)(Cs,{isDisabled:!s},(0,b.createElement)("p",null,(0,d.__)("You can enable / disable tracking the SEO performance for each keyphrase below.","wordpress-seo")),s&&a&&(0,b.createElement)(ts,null),(0,b.createElement)(Is,null,(0,b.createElement)(Ms,{selected:p,onSelect:w,options:c,isLoggedIn:s})),(0,b.createElement)(Ts,null,(0,b.createElement)(Es,{isChartShown:y,datasets:E,keyphrases:r})),(0,b.createElement)(Zt,{startAt:null==p?void 0:p.value,selectedKeyphrases:h,onSelectKeyphrases:g,trackedKeyphrases:t}))};function Os(e){const{isNewlyAuthenticated:t,isLoggedIn:s}=e,r=(0,v.useCallback)((()=>{_s(e)}),[_s,e]),a=yt(s);return(0,b.createElement)(Rs,null,t&&(0,b.createElement)(kt,null),s&&(0,b.createElement)(vt,{trackingInfo:a}),(0,b.createElement)(Ls,null,(0,d.__)("SEO performance","wordpress-seo"),(0,b.createElement)(R.HelpIcon,{linkTo:wpseoAdminL10n["shortlinks.wincher.seo_performance"] /* translators: Hidden accessibility text. */,linkText:(0,d.__)("Learn more about the SEO performance feature.","wordpress-seo")})),(0,b.createElement)(Jt,null),(0,b.createElement)(Ss,{isLoggedIn:s,onLogin:r}),(0,b.createElement)(ks,{...e,onLogin:r}),(0,b.createElement)(As,{...e,historyDaysLimit:(null==a?void 0:a.historyDays)||31}))}As.propTypes={trackedKeyphrases:S().object,keyphrases:S().array.isRequired,isLoggedIn:S().bool.isRequired,shouldTrackAll:S().bool.isRequired,permalink:S().string.isRequired,historyDaysLimit:S().number},Os.propTypes={trackedKeyphrases:S().object,addTrackedKeyphrase:S().func.isRequired,isLoggedIn:S().bool,isNewlyAuthenticated:S().bool,keyphrases:S().array,response:S().object,shouldTrackAll:S().bool,permalink:S().string,historyDaysLimit:S().number},Os.defaultProps={trackedKeyphrases:null,isLoggedIn:!1,isNewlyAuthenticated:!1,keyphrases:[],response:{},shouldTrackAll:!1,permalink:"",historyDaysLimit:0};const Fs=(0,he.compose)([(0,ge.withSelect)((e=>{const{isWincherNewlyAuthenticated:t,getWincherKeyphraseLimitReached:s,getWincherLimit:r,getWincherHistoryDaysLimit:a,getWincherLoginStatus:n,getWincherRequestIsSuccess:o,getWincherRequestResponse:i,getWincherTrackableKeyphrases:l,getWincherTrackedKeyphrases:c,getWincherAllKeyphrasesMissRanking:d,getWincherPermalink:u,shouldWincherAutomaticallyTrackAll:p}=e("yoast-seo/editor");return{keyphrases:l(),trackedKeyphrases:c(),allKeyphrasesMissRanking:d(),isLoggedIn:n(),isNewlyAuthenticated:t(),isSuccess:o(),keyphraseLimitReached:s(),limit:r(),response:i(),shouldTrackAll:p(),permalink:u(),historyDaysLimit:a()}})),(0,ge.withDispatch)((e=>{const{setWincherWebsiteId:t,setWincherRequestSucceeded:s,setWincherRequestFailed:r,setWincherTrackingForKeyphrase:a,setWincherSetKeyphraseLimitReached:n,setWincherLoginStatus:o}=e("yoast-seo/editor");return{setRequestSucceeded:e=>{s(e)},setRequestFailed:e=>{r(e)},addTrackedKeyphrase:e=>{a(e)},setKeyphraseLimitReached:e=>{n(e)},onAuthentication:(e,s,r)=>{t(r),o(e,s)}}}))])(Os);function qs(e,t,s,r){return new Promise(((a,n)=>{jQuery.ajax({type:e,url:t,beforeSend:s?e=>{e.setRequestHeader("X-WP-Nonce",s)}:null,data:r,dataType:"json",success:a,error:n})}))}const $s=window.wp.sanitize,Bs="SNIPPET_EDITOR_UPDATE_REPLACEMENT_VARIABLE",Ds="SNIPPET_EDITOR_UPDATE_REPLACEMENT_VARIABLES_BATCH";function Ws(e,t,s="",r=!1){const a="string"==typeof t?(0,C.decodeHTML)(t):t;return{type:Bs,name:e,value:a,label:s,hidden:r}}function Us(e){return e.charAt(0).toUpperCase()+e.slice(1)}const{stripHTMLTags:Hs}=C.strings,js=["slug","content","contentImage","snippetPreviewImageURL"];function Ks(e,t){(0,l.forEach)(e,((e,s)=>{js.includes(s)||t.dispatch(Ws(s,e))}))}function zs(e){if(!["ct_","cf_","pt_"].includes(e.substring(0,3)))return e.replace(/_/g," ");const t=e.slice(0,3);switch(-1!==(e=e.slice(3)).indexOf("desc_")&&(e=e.slice(5)+" description"),t){case"ct_":e+=" (custom taxonomy)";break;case"cf_":e+=" (custom field)";break;case"pt_":e="Post type ("+(e=e.replace("single","singular"))+")"}return e}function Ys(e){return Us(e=zs(e))}function Vs(e,t){return e.push({name:t.name,label:t.label||Ys(t.name),value:t.value}),e}function Gs(e,t="_"){return e.replace(/\s/g,t)}function Zs(e){return{name:"cf_"+Gs(e),label:Us(e+" (custom field)")}}function Qs(e){const t=Gs(e);return{name:"ct_"+t,label:Us(e+" (custom taxonomy)"),descriptionName:"ct_desc_"+t,descriptionLabel:Us(e+" description (custom taxonomy)")}}function Xs(e,t){if(!e.custom_taxonomies)return e;const s={};return(0,l.forEach)(e.custom_taxonomies,((e,t)=>{const{name:r,label:a,descriptionName:n,descriptionLabel:o}=Qs(t),i="string"==typeof e.name?(0,C.decodeHTML)(e.name):e.name,l="string"==typeof e.description?(0,C.decodeHTML)(e.description):e.description;s[r]={value:i,label:a},s[n]={value:l,label:o}})),t.dispatch(function(e){return{type:Ds,updatedVariables:e}}(s)),(0,l.omit)({...e},"custom_taxonomies")}function Js(e,t){return e.custom_fields?((0,l.forEach)(e.custom_fields,((e,s)=>{const{name:r,label:a}=Zs(s);t.dispatch(Ws(r,e,a))})),(0,l.omit)({...e},"custom_fields")):e}function er(e,t=156){return(e=(e=(0,$s.stripTags)(e)).trim()).length<=t||(e=e.substring(0,t),/\s/.test(e)&&(e=e.substring(0,e.lastIndexOf(" ")))),e}const tr=function(e){const t=(0,l.get)(window,["YoastSEO","app","pluggable"],!1);if(!t||!(0,l.get)(window,["YoastSEO","app","pluggable","loaded"],!1))return function(e){const t=(0,l.get)(window,["YoastSEO","wp","replaceVarsPlugin","replaceVariables"],l.identity);return{url:e.url,title:Hs(t(e.title)),description:Hs(t(e.description)),filteredSEOTitle:e.filteredSEOTitle?Hs(t(e.filteredSEOTitle)):""}}(e);const s=t._applyModifications.bind(t);return{url:e.url,title:Hs(s("data_page_title",e.title)),description:Hs(s("data_meta_desc",e.description)),filteredSEOTitle:e.filteredSEOTitle?Hs(s("data_page_title",e.filteredSEOTitle)):""}};var sr="score-text",rr="image yoast-logo svg",ar=jQuery;function nr(e,t,s=null){var r,a,n,o,i;if(null!==s)return(0,l.get)(s,t,"");const c=(0,ge.select)("yoast-seo/editor").getIsPremium(),u={na:(0,d.__)("Not available","wordpress-seo"),bad:(0,d.__)("Needs improvement","wordpress-seo"),ok:(0,d.__)("OK","wordpress-seo"),good:(0,d.__)("Good","wordpress-seo")},p={keyword:{label:c?(0,d.__)("Premium SEO analysis:","wordpress-seo"):(0,d.__)("SEO analysis:","wordpress-seo"),anchor:"yoast-seo-analysis-collapsible-metabox",status:u},content:{label:(0,d.__)("Readability analysis:","wordpress-seo"),anchor:"yoast-readability-analysis-collapsible-metabox",status:u},"inclusive-language":{label:(0,d.__)("Inclusive language:","wordpress-seo"),anchor:"yoast-inclusive-language-analysis-collapsible-metabox",status:{...u,ok:(0,d.__)("Potentially non-inclusive","wordpress-seo")}}};return null!=p&&null!==(r=p[e])&&void 0!==r&&null!==(a=r.status)&&void 0!==a&&a[t]?`<a href="#${null===(n=p[e])||void 0===n?void 0:n.anchor}">${null===(o=p[e])||void 0===o?void 0:o.label}</a> <strong>${null===(i=p[e])||void 0===i?void 0:i.status[t]}</strong>`:""}S().string.isRequired;const or=b.forwardRef((function(e,t){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),b.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"}))})),ir=b.forwardRef((function(e,t){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),b.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"}))})),lr=({learnMoreLink:e,thumbnail:t,wistiaEmbedPermission:s,upsellLink:r,upsellLabel:a,newToText:n,ctbId:o})=>{const{onClose:i,initialFocus:l}=(0,xe.useModalContext)(),c={a:(0,b.createElement)(Cr,{href:e,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,b.createElement)(ir,{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"}),br:(0,b.createElement)("br",null)};return(0,b.createElement)(b.Fragment,null,(0,b.createElement)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center"},(0,b.createElement)("div",{className:"yst-relative yst-w-full"},(0,b.createElement)(ua,{videoId:"vun9z1dpfh",thumbnail:t,wistiaEmbedPermission:s}),(0,b.createElement)(xe.Badge,{className:"yst-absolute yst-end-4 yst-text-center yst-justify-center",variant:"info",style:{top:"-8px"}},(0,d.__)("Beta","wordpress-seo"))),(0,b.createElement)("div",{className:"yst-mt-6 yst-text-xs yst-font-medium yst-flex yst-flex-col yst-items-center"},(0,b.createElement)("span",{className:"yst-introduction-modal-uppercase yst-flex yst-gap-2 yst-items-center"},(0,b.createElement)("span",{className:"yst-logo-icon"}),n))),(0,b.createElement)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center"},(0,b.createElement)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center"},(0,b.createElement)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium"},(0,d.sprintf)(/* translators: %s: Expands to "Yoast AI" */ (0,d.__)("Optimize your SEO content with %s","wordpress-seo"),"Yoast AI")),(0,b.createElement)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm"},Ne((0,d.sprintf)(/* translators: %1$s is a break tag; %2$s and %3$s are anchor tags; %4$s is the arrow icon. */ (0,d.__)("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>"),c))),(0,b.createElement)("div",{className:"yst-w-full yst-flex yst-mt-6"},(0,b.createElement)(xe.Button,{as:"a",className:"yst-grow",size:"extra-large",variant:"upsell",href:r,target:"_blank",ref:l,"data-action":"load-nfd-ctb","data-ctb-id":o},(0,b.createElement)(or,{className:"yst--ms-1 yst-me-2 yst-h-5 yst-w-5"}),a,(0,b.createElement)("span",{className:"yst-sr-only"},/* translators: Hidden accessibility text. */ (0,d.__)("(Opens in a new browser tab)","wordpress-seo")))),(0,b.createElement)(xe.Button,{as:"a",className:"yst-mt-4",variant:"tertiary",onClick:i},(0,d.__)("Close","wordpress-seo"))))};lr.propTypes={learnMoreLink:S().string.isRequired,upsellLink:S().string.isRequired,thumbnail:S().shape({src:S().string.isRequired,width:S().string,height:S().string}).isRequired,wistiaEmbedPermission:S().shape({value:S().bool.isRequired,status:S().string.isRequired,set:S().func.isRequired}).isRequired,upsellLabel:S().string,newToText:S().string,ctbId:S().string},lr.defaultProps={upsellLabel:(0,d.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. */ (0,d.__)("Unlock with %1$s","wordpress-seo"),"Yoast SEO Premium"),newToText:"Yoast SEO Premium",ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2"};const cr=({handleRefreshClick:e,supportLink:t})=>(0,b.createElement)("div",{className:"yst-flex yst-gap-2"},(0,b.createElement)(xe.Button,{onClick:e},(0,d.__)("Refresh this page","wordpress-seo")),(0,b.createElement)(xe.Button,{variant:"secondary",as:"a",href:t,target:"_blank",rel:"noopener"},(0,d.__)("Contact support","wordpress-seo")));cr.propTypes={handleRefreshClick:S().func.isRequired,supportLink:S().string.isRequired};const dr=({handleRefreshClick:e,supportLink:t})=>(0,b.createElement)("div",{className:"yst-grid yst-grid-cols-1 yst-gap-y-2"},(0,b.createElement)(xe.Button,{className:"yst-order-last",onClick:e},(0,d.__)("Refresh this page","wordpress-seo")),(0,b.createElement)(xe.Button,{variant:"secondary",as:"a",href:t,target:"_blank",rel:"noopener"},(0,d.__)("Contact support","wordpress-seo")));dr.propTypes={handleRefreshClick:S().func.isRequired,supportLink:S().string.isRequired};const ur=({error:e,children:t})=>(0,b.createElement)("div",{role:"alert",className:"yst-max-w-screen-sm yst-p-8 yst-space-y-4"},(0,b.createElement)(xe.Title,null,(0,d.__)("Something went wrong. An unexpected error occurred.","wordpress-seo")),(0,b.createElement)("p",null,(0,d.__)("We're very sorry, but it seems like the following error has interrupted our application:","wordpress-seo")),(0,b.createElement)(xe.Alert,{variant:"error"},(null==e?void 0:e.message)||(0,d.__)("Undefined error message.","wordpress-seo")),(0,b.createElement)("p",null,(0,d.__)("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);ur.propTypes={error:S().object.isRequired,children:S().node},ur.VerticalButtons=dr,ur.HorizontalButtons=cr;const pr={variant:{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"}}},mr=({id:e,children:t,title:s,description:r=null,variant:a="2xl"})=>(0,b.createElement)("section",{id:e,className:pr.variant[a].grid},(0,b.createElement)("div",{className:pr.variant[a].col1},(0,b.createElement)("div",{className:"yst-max-w-screen-sm"},(0,b.createElement)(xe.Title,{as:"h2",size:"4"},s),r&&(0,b.createElement)("p",{className:"yst-mt-2"},r))),(0,b.createElement)("fieldset",{className:`yst-min-w-0 yst-mt-8 ${pr.variant[a].col2}`},(0,b.createElement)("legend",{className:"yst-sr-only"},s),(0,b.createElement)("div",{className:"yst-space-y-8"},t)));var hr;function gr(){return gr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},gr.apply(this,arguments)}mr.propTypes={id:S().string,children:S().node.isRequired,title:S().node.isRequired,description:S().node,variant:S().oneOf(Object.keys(pr.variant))};const yr=e=>b.createElement("svg",gr({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 1000 1000"},e),hr||(hr=b.createElement("path",{fill:"#fff",d:"M500 0C223.9 0 0 223.9 0 500s223.9 500 500 500 500-223.9 500-500S776.1 0 500 0Zm87.2 412.4c0-21.9 4.3-40.2 13.1-54.4s24-27.1 45.9-38.2l10.1-4.9c17.8-9 22.4-16.7 22.4-26 0-11.1-9.5-19.1-25-19.1-18.3 0-32.2 9.5-41.8 28.9l-24.7-24.8c5.4-11.6 14.1-20.9 25.8-28.1a70.8 70.8 0 0 1 38.9-11.1c17.8 0 33.3 4.6 45.9 14.2s19.4 22.7 19.4 39.4c0 26.6-15 42.9-43.1 57.3l-15.7 8c-16.8 8.5-25.1 16-27.4 29.4h85.4v35.4H587.2Zm-82.1 373.3c-157.8 0-285.7-127.9-285.7-285.7s127.9-285.7 285.7-285.7a286.4 286.4 0 0 1 55.9 5.5l-55.9 116.9c-90 0-163.3 73.3-163.3 163.3s73.3 163.3 163.3 163.3a162.8 162.8 0 0 0 106.4-39.6l61.8 107.2a283.9 283.9 0 0 1-168.2 54.8ZM705 704.1l-70.7-122.5H492.9l70.7-122.4H705l70.7 122.4Z"}))),fr=window.ReactDOM;var wr,br,Er;(br=wr||(wr={})).Pop="POP",br.Push="PUSH",br.Replace="REPLACE",function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(Er||(Er={})),new Set(["lazy","caseSensitive","path","id","index","children"]),Error;const vr=["post","put","patch","delete"],kr=(new Set(vr),["get",...vr]);new Set(kr),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred"),b.Component,b.startTransition,new Promise((()=>{})),b.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(e){}var xr,_r,Sr,Rr;new Map,b.startTransition,fr.flushSync,b.useId,"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,(Rr=xr||(xr={})).UseScrollRestoration="useScrollRestoration",Rr.UseSubmit="useSubmit",Rr.UseSubmitFetcher="useSubmitFetcher",Rr.UseFetcher="useFetcher",Rr.useViewTransitionState="useViewTransitionState",(Sr=_r||(_r={})).UseFetcher="useFetcher",Sr.UseFetchers="useFetchers",Sr.UseScrollRestoration="useScrollRestoration",S().string.isRequired,S().string;const Cr=({href:e,children:t,...s})=>(0,b.createElement)(xe.Link,{target:"_blank",rel:"noopener noreferrer",...s,href:e},t,(0,b.createElement)("span",{className:"yst-sr-only"},/* translators: Hidden accessibility text. */ (0,d.__)("(Opens in a new browser tab)","wordpress-seo")));Cr.propTypes={href:S().string.isRequired,children:S().node},Cr.defaultProps={children:null};const Lr=b.forwardRef((function(e,t){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"}))}));var Ir,Tr,Nr;function Pr(){return Pr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},Pr.apply(this,arguments)}const Mr=e=>b.createElement("svg",Pr({xmlns:"http://www.w3.org/2000/svg",id:"star-rating-half_svg__Layer_1","data-name":"Layer 1",viewBox:"0 0 500 475.53"},e),Ir||(Ir=b.createElement("defs",null,b.createElement("style",null,".star-rating-half_svg__cls-1{fill:#fbbf24}"))),Tr||(Tr=b.createElement("path",{d:"M250 392.04 98.15 471.87l29-169.09L4.3 183.03l169.77-24.67L250 4.52l75.93 153.84 169.77 24.67-122.85 119.75 29 169.09L250 392.04z",className:"star-rating-half_svg__cls-1"})),Nr||(Nr=b.createElement("path",{d:"m250 9.04 73.67 149.27.93 1.88 2.08.3 164.72 23.94-119.19 116.19-1.51 1.47.36 2.07 28.14 164.06-147.34-77.46-1.86-1-1.86 1-147.34 77.46 28.14-164.06.36-2.07-1.51-1.47L8.6 184.43l164.72-23.9 2.08-.3.93-1.88L250 9.04m0-9-77.25 156.49L0 181.64l125 121.89-29.51 172L250 394.3l154.51 81.23-29.51-172 125-121.89-172.75-25.11L250 0Z",className:"star-rating-half_svg__cls-1"})),b.createElement("path",{d:"m500 181.64-172.75-25.11L250 0v394.3l154.51 81.23L375 303.48l125-121.84z",style:{fill:"#f3f4f6"}}));function Ar(){return Ar=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},Ar.apply(this,arguments)}const Or=e=>b.createElement("svg",Ar({xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",viewBox:"0 0 500 475.53"},e),b.createElement("path",{d:"m250 0 77.25 156.53L500 181.64 375 303.48l29.51 172.05L250 394.3 95.49 475.53 125 303.48 0 181.64l172.75-25.11L250 0z",style:{fill:"#fbbf24"}}));var Fr,qr,$r;function Br(){return Br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},Br.apply(this,arguments)}const Dr=e=>b.createElement("svg",Br({xmlns:"http://www.w3.org/2000/svg",width:64,height:64,fill:"none"},e),Fr||(Fr=b.createElement("g",{clipPath:"url(#yoast-premium-logo-new_svg__a)"},b.createElement("path",{fill:"url(#yoast-premium-logo-new_svg__b)",d:"M64 64H10.24C4.586 64 0 59.414 0 53.76V10.24C0 4.586 4.586 0 10.24 0h43.52C59.414 0 64 4.586 64 10.24V64Z"}),b.createElement("path",{fill:"#6C2548",d:"m56.016.125-36.06 63.75H64v-53.76c0-4.88-3.414-8.96-7.984-9.987",opacity:.35}),b.createElement("path",{fill:"#fff",d:"M9.523 43.174v4.468c2.765-.116 4.928-1.024 6.759-2.88 1.83-1.856 3.507-4.864 5.107-9.332L33.242 3.686h-5.735L17.96 30.208l-4.736-14.874H7.975l6.963 17.895a7.352 7.352 0 0 1 0 5.35c-.704 1.818-1.971 3.955-5.415 4.595Z"}),b.createElement("path",{fill:"#9FDA4F",d:"M53.274 5.11c-5.99-3.382-13.59-1.27-16.976 4.72-3.386 5.99-1.27 13.59 4.72 16.976 5.99 3.386 13.59 1.27 16.976-4.72 3.382-5.99 1.27-13.59-4.72-16.976Z"}),b.createElement("path",{fill:"#77B227",d:"M53.274 5.11 41.018 26.806c5.99 3.386 13.59 1.27 16.976-4.72 3.382-5.99 1.27-13.59-4.72-16.976Z"}),b.createElement("path",{fill:"#FEC228",d:"M37.731 32.608s-.012-.006-.019-.013c-.006 0-.01-.006-.016-.01a8.134 8.134 0 0 0-11.091 3.085 8.145 8.145 0 0 0 3.104 11.108 8.139 8.139 0 0 0 11.075-3.095 8.14 8.14 0 0 0-3.05-11.072"}),b.createElement("path",{fill:"#F49A00",d:"m37.696 32.586-8.01 14.179a8.145 8.145 0 0 0 11.095-3.085 8.144 8.144 0 0 0-3.085-11.094Z"}),b.createElement("path",{fill:"#FF4E47",d:"M28.454 57.61a4.89 4.89 0 0 0-2.477-4.256 4.863 4.863 0 0 0-2.4-.634c-2.69 0-4.892 2.18-4.892 4.883a4.882 4.882 0 0 0 4.883 4.893 4.882 4.882 0 0 0 4.893-4.883"}),b.createElement("path",{fill:"#ED261F",d:"m25.971 53.35-4.806 8.51a4.882 4.882 0 0 0 6.656-1.854 4.882 4.882 0 0 0-1.853-6.656"}),b.createElement("path",{fill:"#CD82AB",d:"M57.402 58.086H43.888v1.197h13.514v-1.197ZM53.75 53.366l-3.103-5.76v.004l-.004-.004-3.104 5.76-4.777-3.42 1.126 7.702h13.514l1.126-7.702-4.777 3.42Z"}))),qr||(qr=b.createElement("path",{stroke:"#fff",d:"M10 .5h44a9.5 9.5 0 0 1 9.5 9.5v53.5H10A9.5 9.5 0 0 1 .5 54V10A9.5 9.5 0 0 1 10 .5Z"})),$r||($r=b.createElement("defs",null,b.createElement("linearGradient",{id:"yoast-premium-logo-new_svg__b",x1:-2.912,x2:68.509,y1:25.843,y2:38.438,gradientUnits:"userSpaceOnUse"},b.createElement("stop",{stopColor:"#5D237A"}),b.createElement("stop",{offset:.08,stopColor:"#702175"}),b.createElement("stop",{offset:.22,stopColor:"#872070"}),b.createElement("stop",{offset:.36,stopColor:"#981E6C"}),b.createElement("stop",{offset:.51,stopColor:"#A21E69"}),b.createElement("stop",{offset:.7,stopColor:"#A61E69"})),b.createElement("clipPath",{id:"yoast-premium-logo-new_svg__a"},b.createElement("path",{fill:"#fff",d:"M0 10C0 4.477 4.477 0 10 0h44c5.523 0 10 4.477 10 10v54H10C4.477 64 0 59.523 0 54V10Z"})))));var Wr,Ur,Hr;function jr(){return jr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},jr.apply(this,arguments)}const Kr=e=>b.createElement("svg",jr({xmlns:"http://www.w3.org/2000/svg",width:64,height:64,fill:"none"},e),Wr||(Wr=b.createElement("g",{clipPath:"url(#woo-seo-logo-new_svg__a)"},b.createElement("path",{fill:"#0E1E65",d:"M64 64H10.24C4.586 64 0 59.414 0 53.76V10.24C0 4.586 4.586 0 10.24 0h43.52C59.414 0 64 4.586 64 10.24V64Z"}),b.createElement("path",{fill:"#0075B3",d:"M56.016.253 19.956 64H64V10.24c0-4.88-3.414-8.96-7.984-9.987Z"}),b.createElement("path",{fill:"#fff",d:"M9.523 43.174v4.468c2.765-.116 4.928-1.024 6.759-2.88 1.83-1.856 3.507-4.864 5.107-9.332L33.242 3.686h-5.735L17.96 30.208l-4.736-14.874H7.975l6.963 17.895a7.352 7.352 0 0 1 0 5.35c-.704 1.818-1.971 3.955-5.415 4.595Z"}),b.createElement("path",{fill:"#9FDA4F",d:"M53.274 5.11c-5.99-3.382-13.59-1.27-16.976 4.72-3.386 5.99-1.27 13.59 4.72 16.976 5.99 3.386 13.59 1.27 16.976-4.72 3.382-5.99 1.27-13.59-4.72-16.976Z"}),b.createElement("path",{fill:"#FEC228",d:"M37.731 32.608s-.012-.006-.019-.013c-.006 0-.01-.006-.016-.01a8.134 8.134 0 0 0-11.091 3.085 8.145 8.145 0 0 0 3.104 11.108 8.139 8.139 0 0 0 11.075-3.095 8.14 8.14 0 0 0-3.05-11.072"}),b.createElement("path",{fill:"#FF4E47",d:"M28.454 57.61a4.89 4.89 0 0 0-2.477-4.256 4.863 4.863 0 0 0-2.4-.634c-2.69 0-4.892 2.18-4.892 4.883a4.882 4.882 0 0 0 4.883 4.893 4.882 4.882 0 0 0 4.893-4.883"}),b.createElement("path",{fill:"#77B227",d:"M53.274 5.11 41.018 26.806c5.99 3.386 13.59 1.27 16.976-4.72 3.382-5.99 1.27-13.59-4.72-16.976Z"}),b.createElement("path",{fill:"#F49A00",d:"m37.696 32.586-8.01 14.179a8.145 8.145 0 0 0 11.095-3.085 8.144 8.144 0 0 0-3.085-11.094Z"}),b.createElement("path",{fill:"#ED261F",d:"m25.971 53.35-4.806 8.51a4.882 4.882 0 0 0 6.656-1.854 4.882 4.882 0 0 0-1.853-6.656"}),b.createElement("path",{fill:"#A1CCE3",d:"M58.102 46.806a1.26 1.26 0 0 0-1.219.938l-.157.582a40.97 40.97 0 0 0-10.857 1.261c-.013 0-.023.007-.035.01a.503.503 0 0 0-.317.64 40.344 40.344 0 0 0 1.99 4.86c.083.173.26.282.455.282h7.542c.64 0 1.213.403 1.427 1.008h-10a.507.507 0 0 0 0 1.011h10.592a.507.507 0 0 0 .506-.505c0-1.149-.775-2.15-1.888-2.442L57.862 48a.25.25 0 0 1 .243-.186h.932a.507.507 0 0 0 0-1.01h-.931l-.004.002ZM57.018 59.92a1.008 1.008 0 1 1 0-2.016 1.008 1.008 0 0 1 0 2.016Zm-8.573 0a1.008 1.008 0 1 1 0-2.016 1.008 1.008 0 0 1 0 2.016Z"}))),Ur||(Ur=b.createElement("path",{stroke:"#fff",d:"M10 .5h44a9.5 9.5 0 0 1 9.5 9.5v53.5H10A9.5 9.5 0 0 1 .5 54V10A9.5 9.5 0 0 1 10 .5Z"})),Hr||(Hr=b.createElement("defs",null,b.createElement("clipPath",{id:"woo-seo-logo-new_svg__a"},b.createElement("path",{fill:"#fff",d:"M0 10C0 4.477 4.477 0 10 0h44c5.523 0 10 4.477 10 10v54H10C4.477 64 0 59.523 0 54V10Z"}))))),zr=b.forwardRef((function(e,t){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),b.createElement("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"}))}));var Yr=s(4530),Vr=s.n(Yr);const Gr=({link:e,linkProps:t,isPromotionActive:s,isWooCommerceActive:r})=>{const a=r?Te:Ie;let n=(0,v.useMemo)((()=>(0,d.__)("Now with Local, News & Video SEO + 1 Google Docs seat!","wordpress-seo")),[]),o=Ne(r?(0,d.sprintf)(/* translators: %1$s and %2$s expand to a span wrap to avoid linebreaks. %3$s expands to "Yoast SEO Premium". */ (0,d.__)("%1$s%2$s %3$s","wordpress-seo"),"<nowrap>","</nowrap>","Yoast WooCommerce SEO"):(0,d.sprintf)(/* translators: %1$s and %2$s expand to a span wrap to avoid linebreaks. %3$s expands to "Yoast SEO Premium". */ (0,d.__)("%1$s%2$s %3$s","wordpress-seo"),"<nowrap>","</nowrap>","Yoast SEO Premium"),{nowrap:(0,b.createElement)("span",{className:"yst-whitespace-nowrap"})});const i=s("black-friday-2024-promotion");return i&&(n=(0,v.useMemo)((()=>(0,d.__)("If you were thinking about upgrading, now's the time! 30% OFF ends 3rd Dec 11am (CET)","wordpress-seo")),[]),o=Ne((0,d.sprintf)(/* translators: %1$s and %2$s expand to a span wrap to avoid linebreaks. %3$s expands to "Yoast SEO Premium". */ (0,d.__)("%1$sBuy%2$s %3$s","wordpress-seo"),"<nowrap>","</nowrap>","Yoast SEO Premium"),{nowrap:(0,b.createElement)("span",{className:"yst-whitespace-nowrap"})})),(0,b.createElement)("div",{className:Vr()("yst-p-6 yst-rounded-lg yst-text-white yst-shadow",r?"yst-bg-[#0e1e65]":"yst-bg-primary-500")},(0,b.createElement)("figure",{className:"yst-logo-square yst-w-16 yst-h-16 yst-mx-auto yst-overflow-hidden yst-relative yst-z-10 yst-mt-[-2.6rem]"},r?(0,b.createElement)(Kr,null):(0,b.createElement)(Dr,null)),i&&(0,b.createElement)("div",{className:"sidebar__sale_banner_container"},(0,b.createElement)("div",{className:"sidebar__sale_banner"},(0,b.createElement)("span",{className:"banner_text"},(0,d.__)("30% OFF - BLACK FRIDAY","wordpress-seo")))),(0,b.createElement)(xe.Title,{as:"h2",className:"yst-mt-6 yst-text-base yst-font-extrabold yst-text-white"},o),(0,b.createElement)("p",{className:"yst-mt-2 yst-font-medium"},n),(0,b.createElement)("ul",{className:"yst-ps-[1em] yst-list-outside yst-text-white yst-mt-2"},a(!0).map(((e,t)=>(0,b.createElement)("li",{key:`upsell-benefit-${t}`,className:"yst-flex yst-items-center yst-gap-2"},(0,b.createElement)(zr,{className:"yst-w-4 yst-h-4 yst-text-green-400"}),(0,b.createElement)("span",null,e))))),(0,b.createElement)(xe.Button,{as:"a",variant:"upsell",href:e,target:"_blank",rel:"noopener",className:"yst-flex yst-justify-center yst-gap-2 yst-mt-4 focus:yst-ring-offset-primary-500",...t},(0,b.createElement)("span",null,(0,d.__)("Buy now","wordpress-seo")),(0,b.createElement)(Lr,{className:"yst-w-4 yst-h-4 yst-icon-rtl"})),(0,b.createElement)("p",{className:"yst-text-center yst-text-xs yst-mx-2 yst-font-light yst-leading-5 yst-mt-2"},(0,d.__)("30-day money back guarantee","wordpress-seo")),(0,b.createElement)("hr",{className:"yst-border-t yst-border-primary-300 yst-my-4"}),(0,b.createElement)("a",{className:"yst-block yst-mt-4 yst-no-underline",href:"https://www.g2.com/products/yoast-yoast/reviews",target:"_blank",rel:"noopener noreferrer"},(0,b.createElement)("span",{className:"yst-flex yst-gap-2 yst-mt-2 yst-items-center"},(0,b.createElement)(yr,{className:"yst-w-5 yst-h-5"}),(0,b.createElement)("span",{className:"yst-flex yst-gap-1"},(0,b.createElement)(Or,{className:"yst-w-5 yst-h-5"}),(0,b.createElement)(Or,{className:"yst-w-5 yst-h-5"}),(0,b.createElement)(Or,{className:"yst-w-5 yst-h-5"}),(0,b.createElement)(Or,{className:"yst-w-5 yst-h-5"}),(0,b.createElement)(Mr,{className:"yst-w-5 yst-h-5"})),(0,b.createElement)("span",{className:"yst-text-sm yst-font-semibold yst-text-white"},"4.6 / 5"))))};var Zr;function Qr(){return Qr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},Qr.apply(this,arguments)}Gr.propTypes={link:S().string.isRequired,linkProps:S().object,isPromotionActive:S().func},Gr.defaultProps={linkProps:{},isPromotionActive:l.noop};const Xr=e=>b.createElement("svg",Qr({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 12"},e),Zr||(Zr=b.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"})));var Jr;function ea(){return ea=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},ea.apply(this,arguments)}const ta=e=>b.createElement("svg",ea({xmlns:"http://www.w3.org/2000/svg",width:14,height:14,fill:"none"},e),Jr||(Jr=b.createElement("path",{fill:"#0075B3",d:"M12.613.445a1.26 1.26 0 0 0-1.22.937l-.156.583A40.97 40.97 0 0 0 .379 3.225c-.013 0-.022.007-.035.01a.503.503 0 0 0-.317.64 40.344 40.344 0 0 0 1.99 4.861c.084.173.26.282.455.282h7.542c.64 0 1.213.403 1.427 1.008h-10a.507.507 0 0 0 0 1.01h10.592a.507.507 0 0 0 .506-.505c0-1.149-.774-2.15-1.888-2.441l1.722-6.452a.25.25 0 0 1 .243-.185h.931a.507.507 0 0 0 0-1.011h-.931l-.003.003Zm-1.085 13.114a1.008 1.008 0 1 1 0-2.016 1.008 1.008 0 0 1 0 2.016Zm-8.573 0a1.008 1.008 0 1 1 0-2.016 1.008 1.008 0 0 1 0 2.016Z"}))),sa=({premiumLink:e,premiumUpsellConfig:t,isPromotionActive:s,isWooCommerceActive:r})=>{const a=s("black-friday-2024-promotion"),n=r?Te:Ie;return(0,b.createElement)(xe.Paper,{as:"div",className:"xl:yst-max-w-3xl"},a&&(0,b.createElement)("div",{className:"yst-rounded-t-lg yst-h-9 yst-flex yst-justify-between yst-items-center yst-bg-black yst-text-amber-300 yst-px-4 yst-text-lg yst-border-b yst-border-amber-300 yst-border-solid yst-font-semibold"},(0,b.createElement)("div",null,(0,d.__)("30% OFF","wordpress-seo")),(0,b.createElement)("div",null,(0,d.__)("BLACK FRIDAY","wordpress-seo"))),(0,b.createElement)("div",{className:"yst-p-6 yst-flex yst-flex-col"},(0,b.createElement)("div",{className:"yst-flex yst-items-center"},r?(0,b.createElement)(b.Fragment,null,(0,b.createElement)(xe.Title,{as:"h2",size:"4",className:"yst-text-xl yst-text-primary-500"},(0,d.sprintf)(/* translators: %s expands to "Yoast SEO" Premium */ (0,d.__)("Upgrade to %s","wordpress-seo"),"Yoast WooCommerce SEO")),(0,b.createElement)(ta,{className:"yst-ml-2 yst-w-4 yst-h-3"})):(0,b.createElement)(b.Fragment,null,(0,b.createElement)(xe.Title,{as:"h2",size:"4",className:"yst-text-xl yst-text-primary-500"},(0,d.sprintf)(/* translators: %s expands to "Yoast SEO" Premium */ (0,d.__)("Upgrade to %s","wordpress-seo"),"Yoast SEO Premium")),(0,b.createElement)(Xr,{className:"yst-ml-2 yst-w-4 yst-h-3"}))),(0,b.createElement)("span",{className:"yst-font-medium yst-text-slate-500 yst-text-xs yst-leading-5 yst-uppercase yst-mt-2"},(0,d.__)("Now includes Local, News & Video SEO + 1 Google Docs seat!","wordpress-seo")),(0,b.createElement)("ul",{className:"yst-grid yst-grid-cols-1 sm:yst-grid-cols-2 yst-gap-x-6 yst-list-none yst-list-outside yst-text-slate-600 yst-mt-6"},n().map(((e,t)=>(0,b.createElement)("li",{key:`upsell-benefit-${t}`},(0,b.createElement)("span",{className:"yst-mx-2"},"•"),e)))),(0,b.createElement)(xe.Button,{as:"a",variant:"upsell",size:"extra-large",href:e,className:"yst-gap-2 yst-mt-4",target:"_blank",rel:"noopener",...t},r?(0,d.sprintf)(/* translators: %s expands to "Yoast WooCommerce SEO" */ (0,d.__)("Explore %s now!","wordpress-seo"),"Yoast WooCommerce SEO"):(0,d.sprintf)(/* translators: %s expands to "Yoast SEO" Premium */ (0,d.__)("Explore %s now!","wordpress-seo"),"Yoast SEO Premium"),(0,b.createElement)(Lr,{className:"yst-w-4 yst-h-4 yst-icon-rtl"}))))};sa.propTypes={premiumLink:S().string.isRequired,premiumUpsellConfig:S().object,isPromotionActive:S().func,isWooCommerceActive:S().bool.isRequired},sa.defaultProps={premiumUpsellConfig:{},isPromotionActive:l.noop},S().string.isRequired,S().object.isRequired,S().string.isRequired,S().func.isRequired,S().bool.isRequired;const ra=b.forwardRef((function(e,t){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),b.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"}))})),aa=({isOpen:e,onClose:t=l.noop,onDiscard:s=l.noop,title:r,description:a,dismissLabel:n,discardLabel:o})=>{const i=(0,xe.useSvgAria)();return(0,b.createElement)(xe.Modal,{isOpen:e,onClose:t},(0,b.createElement)(xe.Modal.Panel,{closeButtonScreenReaderText:(0,d.__)("Close","wordpress-seo")},(0,b.createElement)("div",{className:"sm:yst-flex sm:yst-items-start"},(0,b.createElement)("div",{className:"yst-mx-auto yst-flex-shrink-0 yst-flex yst-items-center yst-justify-center yst-h-12 yst-w-12 yst-rounded-full yst-bg-red-100 sm:yst-mx-0 sm:yst-h-10 sm:yst-w-10"},(0,b.createElement)(ra,{className:"yst-h-6 yst-w-6 yst-text-red-600",...i})),(0,b.createElement)("div",{className:"yst-mt-3 yst-text-center sm:yst-mt-0 sm:yst-ms-4 sm:yst-text-start"},(0,b.createElement)(xe.Modal.Title,{className:"yst-text-lg yst-leading-6 yst-font-medium yst-text-slate-900 yst-mb-3"},r),(0,b.createElement)(xe.Modal.Description,{className:"yst-text-sm yst-text-slate-500"},a))),(0,b.createElement)("div",{className:"yst-flex yst-flex-col sm:yst-flex-row-reverse yst-gap-3 yst-mt-6"},(0,b.createElement)(xe.Button,{type:"button",variant:"error",onClick:s,className:"yst-block"},o),(0,b.createElement)(xe.Button,{type:"button",variant:"secondary",onClick:t,className:"yst-block"},n))))};aa.propTypes={isOpen:S().bool.isRequired,onClose:S().func,onDiscard:S().func,title:S().string.isRequired,description:S().string.isRequired,dismissLabel:S().string.isRequired,discardLabel:S().string.isRequired};const na=window.yoast.reactHelmet,oa="error",ia="loading",la="showPlay",ca="askPermission",da="isPlaying",ua=({videoId:e,thumbnail:t,wistiaEmbedPermission:s})=>{const[r,a]=(0,v.useState)(s.value?da:la),n=(0,v.useCallback)((()=>a(da)),[a]),o=(0,v.useCallback)((()=>{s.value?n():a(ca)}),[s.value,n,a]),i=(0,v.useCallback)((()=>a(la)),[a]),l=(0,v.useCallback)((()=>{s.set(!0),n()}),[s.set,n]);return(0,b.createElement)(b.Fragment,null,s.value&&(0,b.createElement)(na.Helmet,null,(0,b.createElement)("script",{src:"https://fast.wistia.com/assets/external/E-v1.js",async:!0})),(0,b.createElement)("div",{className:"yst-relative yst-w-full yst-h-0 yst-pt-[56.25%] yst-overflow-hidden yst-rounded-md yst-drop-shadow-md yst-bg-white"},r===la&&(0,b.createElement)("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:o},(0,b.createElement)("img",{className:"yst-w-full yst-h-auto",alt:"",loading:"lazy",decoding:"async",...t})),r===ca&&(0,b.createElement)("div",{className:"yst-absolute yst-inset-0 yst-flex yst-flex-col yst-items-center yst-justify-center yst-bg-white"},(0,b.createElement)("p",{className:"yst-max-w-xs yst-mx-auto yst-text-center"},s.status===ia&&(0,b.createElement)(xe.Spinner,null),s.status!==ia&&(0,d.sprintf)(/* translators: %1$s expands to Yoast SEO. %2$s expands to Wistia. */ (0,d.__)("To see this video, you need to allow %1$s to load embedded videos from %2$s.","wordpress-seo"),"Yoast SEO","Wistia")),(0,b.createElement)("div",{className:"yst-flex yst-mt-6 yst-gap-x-4"},(0,b.createElement)(xe.Button,{type:"button",variant:"secondary",onClick:i,disabled:s.status===ia},(0,d.__)("Deny","wordpress-seo")),(0,b.createElement)(xe.Button,{type:"button",variant:"primary",onClick:l,disabled:s.status===ia},(0,d.__)("Allow","wordpress-seo")))),s.value&&r===da&&(0,b.createElement)("div",{className:"yst-absolute yst-w-full yst-h-full yst-top-0 yst-right-0"},null===e&&(0,b.createElement)(xe.Spinner,{className:"yst-h-full yst-mx-auto"}),null!==e&&(0,b.createElement)("div",{className:`wistia_embed wistia_async_${e} videoFoam=true`}))))};var pa,ma;function ha(){return ha=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},ha.apply(this,arguments)}ua.propTypes={videoId:S().string.isRequired,thumbnail:S().shape({src:S().string.isRequired,width:S().string,height:S().string}).isRequired,wistiaEmbedPermission:S().shape({value:S().bool.isRequired,status:S().string.isRequired,set:S().func.isRequired}).isRequired},b.forwardRef((function(e,t){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),b.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"}))})),S().bool.isRequired,S().func.isRequired,S().func,S().string;const ga=({onGiveConsent:e,learnMoreLink:t,privacyPolicyLink:s,termsOfServiceLink:r,imageLink:a})=>{const{onClose:n,initialFocus:o}=(0,xe.useModalContext)(),[i,l]=(0,xe.useToggleState)(!1),c=(0,v.useMemo)((()=>({src:a,width:"432",height:"244"})),[a]),u=Ne((0,d.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. */ (0,d.__)("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,b.createElement)(Cr,{href:r}),a2:(0,b.createElement)(Cr,{href:s})}),[p,m]=(0,xe.useToggleState)(!1),h=(0,v.useCallback)((async()=>{m(),await e(),m()}),[e]);return(0,b.createElement)(b.Fragment,null,(0,b.createElement)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center"},(0,b.createElement)("div",{className:"yst-relative yst-w-full"},(0,b.createElement)("img",{className:"yst-w-full yst-h-auto yst-rounded-md yst-drop-shadow-md",alt:"",loading:"lazy",decoding:"async",...c}))),(0,b.createElement)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center"},(0,b.createElement)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center"},(0,b.createElement)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium"},(0,d.sprintf)(/* translators: %s expands to Yoast AI. */ (0,d.__)("Grant consent for %s","wordpress-seo"),"Yoast AI")),(0,b.createElement)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm"},Ne((0,d.sprintf)(/* translators: %1$s is a break tag; %2$s and %3$s are anchor tag; %4$s is the arrow icon. */ (0,d.__)("Enable AI-powered SEO! Use all AI Generate and Optimize 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,b.createElement)(Cr,{href:t,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,b.createElement)(ir,{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"}),br:(0,b.createElement)("br",null)}))),(0,b.createElement)("div",{className:"yst-flex yst-w-full yst-mt-6"},(0,b.createElement)("hr",{className:"yst-w-full yst-text-gray-200"})),(0,b.createElement)("div",{className:"yst-flex yst-items-start yst-mt-4"},(0,b.createElement)("input",{type:"checkbox",id:"yst-ai-consent-checkbox",name:"yst-ai-consent-checkbox",checked:i,value:i?"true":"false",onChange:l,className:"yst-checkbox__input",ref:o}),(0,b.createElement)("label",{htmlFor:"yst-ai-consent-checkbox",className:"yst-label yst-checkbox__label yst-text-xs yst-font-normal yst-text-slate-500"},u)),(0,b.createElement)("div",{className:"yst-w-full yst-flex yst-mt-4"},(0,b.createElement)(xe.Button,{as:"button",className:"yst-grow",size:"large",disabled:!i,onClick:h},p&&(0,b.createElement)(xe.Spinner,{className:"yst-me-2"}),(0,d.__)("Grant consent","wordpress-seo"))),(0,b.createElement)(xe.Button,{as:"button",className:"yst-mt-4",variant:"tertiary",onClick:n},(0,d.__)("Close","wordpress-seo"))))};ga.propTypes={onGiveConsent:S().func.isRequired,learnMoreLink:S().string.isRequired,privacyPolicyLink:S().string.isRequired,termsOfServiceLink:S().string.isRequired,imageLink:S().string.isRequired};b.forwardRef((function(e,t){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),b.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"}))})),window.yoast.aiFrontend;const ya="yoast-seo/ai-generator",fa="yoast-seo/editor",wa="google",ba="social",Ea="twitter",va="title",ka="description",xa="post",_a="term",Sa={post:"title",term:"term_title"},Ra=(0,l.mapValues)(Sa,(e=>`%%${e}%%`)),Ca={mobile:"mobile",desktop:"desktop"},La={idle:"idle",loading:"loading",success:"success",error:"error"},Ia="success",Ta="error",Na="abort";let Pa,Ma=!1;const Aa=["_formal","_informal","_ao90"],Oa=e=>{for(const t of Aa)if(e.endsWith(t))return e.slice(0,-t.length);return e},Fa=async({endpoint:e,data:t})=>{let s;const r=1e3*(0,l.get)(window,"wpseoAiGenerator.requestTimeout",30);try{Pa&&Pa.abort(),Pa=new AbortController,Ma=!1,s=setTimeout((()=>{Ma=!0,Pa.abort()}),r);const a=await it()({path:e,method:"POST",data:t,parse:!1,signal:Pa.signal}),n=await a.json();return{status:Ia,payload:n}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return Ma?{status:Ta,payload:{message:"timeout",code:408}}:{status:Na};const{message:t,missingLicenses:s,errorIdentifier:r}=await(async e=>{try{const t=e.body.getReader(),{value:s}=await t.read(),r=new TextDecoder("utf-8").decode(s);return console.error(r),JSON.parse(r)}catch(e){return{message:"Unknown"}}})(e);return{status:Ta,payload:{message:t,code:e.status||500,missingLicenses:s,errorIdentifier:r}}}finally{clearTimeout(s)}},qa="\\–\\-\\(\\)_\\[\\]’‘“”〝〞〟‟„\"'.?!:;,¿¡«»‹›—×+&۔؟،؛。。!‼?⁇⁉⁈‥…・ー、〃〄〆〇〈〉《》「」『』【】〒〓〔〕〖〗〘〙〚〛〜〝〞〟〠〶〼〽{}|~⦅⦆「」、[]・¥$%@&'()*/:;<>\\\<>";qa.split(""),new RegExp("^["+qa+"]+"),new RegExp("["+qa+"]+$");new RegExp("["+qa+"#$%&*+/=@^`{|}~ -¿–-⁊ -₠-⃀]","g");const $a=e=>{const t={...e};return""!==e.value||["title","excerpt","excerpt_only"].includes(e.name)||(t.value="%%"+e.name+"%%"),t.badge=`<badge>${e.label}</badge>`,t},Ba={editType:va,previewType:wa,postType:"post",contentType:xa},Da=(0,v.createContext)(Ba),Wa=(Da.Provider,()=>(0,v.useContext)(Da)),Ua=()=>(0,v.useContext)(o.LocationContext),Ha=e=>{const t=(0,v.useRef)(null);return(0,v.useCallback)((s=>{(0,l.attempt)((()=>t.current&&t.current.disconnect())),null!==s&&(t.current=new ResizeObserver((t=>{(0,l.forEach)(t,(t=>e(t)))})),t.current.observe(s))}),[e])},ja=window.yoast.reduxJsToolkit,Ka=(0,ja.createSlice)({name:"suggestions",initialState:{status:La.loading,error:{code:200,message:""},entities:[],selected:""},reducers:{setLoading:e=>{e.status=La.loading},setSuccess:(e,{payload:t})=>{e.status=La.success,e.selected=t[0],e.entities.push(...t)},setError:(e,{payload:t})=>{e.status=La.error,e.error=t},setSelected:(e,{payload:t})=>{e.selected=t}}}),za=e=>{switch(e){case ba:return"Facebook";case Ea:return"Twitter";default:return"Google"}},Ya=window.yoast.searchMetadataPreviews,Va="usageCount",Ga="fetchUsageCount",Za=`${Ga}/success`,Qa={errorCode:null,errorIdentifier:null,errorMessage:null},Xa=(0,ja.createSlice)({name:Va,initialState:{status:"idle",count:0,limit:10,endpoint:"yoast/v1/ai_generator/get_usage",error:Qa},reducers:{addUsageCount:(e,{payload:t=1})=>{e.count+=t},setUsageCount:(e,{payload:t})=>{e.count=t},setUsageCountEndpoint:(e,{payload:t})=>{e.endpoint=t},setUsageCountLimit:(e,{payload:t})=>{e.limit=t}},extraReducers:e=>{e.addCase(`${Ga}/request`,(e=>{e.status=ia,e.error=Qa})),e.addCase(Za,((e,{payload:t})=>{e.status="success",e.count=t.count,e.limit=t.limit,e.error=Qa})),e.addCase(`${Ga}/${oa}`,((e,{payload:t})=>{e.status="error",e.error={errorCode:502,...t}}))}}),Ja=(Xa.getInitialState,{selectUsageCountStatus:e=>(0,l.get)(e,[Va,"status"],Xa.getInitialState()),selectUsageCount:e=>(0,l.get)(e,[Va,"count"],Xa.getInitialState().count),selectUsageCountLimit:e=>(0,l.get)(e,[Va,"limit"],Xa.getInitialState().limit),selectUsageCountEndpoint:e=>(0,l.get)(e,[Va,"endpoint"],Xa.getInitialState().endpoint),selectUsageCountError:e=>(0,l.get)(e,[Va,"error"],Xa.getInitialState().error)});Ja.selectUsageCountRemaining=(0,ja.createSelector)([Ja.selectUsageCount,Ja.selectUsageCountLimit],((e,t)=>Math.max(t-e,0))),Ja.isUsageCountLimitReached=(0,ja.createSelector)([Ja.selectUsageCount,Ja.selectUsageCountLimit,Ja.selectUsageCountError],((e,t,s)=>429===s.errorCode||e>=t)),Xa.actions,Xa.reducer;const en=()=>{const e=(0,ge.useSelect)((e=>e(fa).selectLink("https://yoa.st/ai-common-errors")),[]),t=(0,ge.useSelect)((e=>e(fa).selectAdminLink("?page=wpseo_page_support")),[]);return(0,b.createElement)(xe.Alert,{variant:"error"},(0,b.createElement)("span",{className:"yst-block yst-font-medium"},(0,d.__)("Something went wrong","wordpress-seo")),(0,b.createElement)("p",{className:"yst-mt-2"},Ne((0,d.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ (0,d.__)("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,b.createElement)(Cr,{variant:"error",href:e}),a2:(0,b.createElement)(Cr,{variant:"error",href:t})})))},tn=()=>{const e=(0,ge.useSelect)((e=>e(fa).selectLink("https://yoa.st/ai-common-errors")),[]),t=(0,ge.useSelect)((e=>e(fa).selectAdminLink("?page=wpseo_page_support")),[]);return(0,b.createElement)(xe.Alert,{variant:"error"},(0,b.createElement)("span",{className:"yst-block yst-font-medium"},(0,d.__)("Not enough content","wordpress-seo")),(0,b.createElement)("p",{className:"yst-mt-2"},Ne((0,d.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ (0,d.__)("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,b.createElement)(Cr,{variant:"error",href:e}),a2:(0,b.createElement)(Cr,{variant:"error",href:t})})))},sn=()=>{const e=(0,ge.useSelect)((e=>e(fa).selectAdminLink("?page=wpseo_page_settings#/site-features#card-wpseo-keyword_analysis_active")),[]),t=(0,v.useCallback)((()=>{window.location.reload()}),[]),{onClose:s}=(0,xe.useModalContext)();return(0,b.createElement)(b.Fragment,null,(0,b.createElement)(xe.Alert,{variant:"error"},(0,b.createElement)("span",{className:"yst-block yst-font-medium"},(0,d.__)("SEO analysis required","wordpress-seo")),(0,b.createElement)("p",{className:"yst-mt-2"},Ne((0,d.sprintf)( /** * translators: * %1$s expands to Yoast SEO. * %2$s and %3$s expand to an opening and closing anchor tag, respectively, that links to the settings page. * %4$s expands to Yoast AI. */ (0,d.__)("%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,b.createElement)(Cr,{variant:"error",href:e})}))),(0,b.createElement)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end"},(0,b.createElement)(xe.Button,{variant:"secondary",onClick:s},(0,d.__)("Close","wordpress-seo")),(0,b.createElement)(xe.Button,{className:"yst-revoke-button",variant:"primary",onClick:t},(0,d.__)("Refresh page","wordpress-seo"))))},rn=()=>{const e=(0,ge.useSelect)((e=>e(fa).selectLink("https://yoa.st/ai-generator-rate-limit-help")),[]);return(0,b.createElement)(xe.Alert,{variant:"error"},(0,b.createElement)("span",{className:"yst-block yst-font-medium"},(0,d.__)("You've reached the Yoast AI rate limit","wordpress-seo")),(0,b.createElement)("p",{className:"yst-mt-2"},Ne((0,d.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ (0,d.__)("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,b.createElement)(Cr,{variant:"error",href:e})})))},an=({invalidSubscriptions:e=[]})=>{const{newYoastWooLink:t,activateYoastWooLink:s,newPremiumLink:r,activatePremiumLink:a}=(0,ge.useSelect)((e=>{const t=e(fa);return{newYoastWooLink:t.selectLink("https://yoa.st/ai-generator-new-yoast-woocommerce"),activateYoastWooLink:t.selectLink("https://yoa.st/ai-generator-activate-yoast-woocommerce"),newPremiumLink:t.selectLink("https://yoa.st/ai-generator-new-premium"),activatePremiumLink:t.selectLink("https://yoa.st/ai-generator-activate-premium")}}),[]),{onClose:n}=(0,xe.useModalContext)(),o=(0,v.useCallback)((async()=>{try{await it()({path:"yoast/v1/ai_generator/bust_subscription_cache",method:"POST",parse:!1})}catch(e){console.error(e)}window.location.reload()}),[]);let i,l,c;return e.includes("Yoast WooCommerce SEO")?(i="Yoast WooCommerce SEO",l=s,c=t):e.includes("Yoast SEO Premium")&&(i="Yoast SEO Premium",l=a,c=r),(0,b.createElement)(v.Fragment,null,(0,b.createElement)(xe.Alert,{variant:"error"},(0,b.createElement)("span",{className:"yst-block yst-font-medium"},(0,d.__)("Subscription required","wordpress-seo")),(0,b.createElement)("p",{className:"yst-mt-2"},Ne((0,d.sprintf)( /** * translators: * %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. * %2$s expands to MyYoast. * %3$s and %4$s expand to an opening and closing anchor tag, respectively, to activate your subscription. * %5$s and %6$s expand to an opening and closing anchor tag, respectively, to get a new subscription. **/ (0,d.__)("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"),i,"MyYoast","<Activate>","</Activate>","<New>","</New>"),{Activate:(0,b.createElement)(Cr,{variant:"error",href:l}),New:(0,b.createElement)(Cr,{variant:"error",href:c})}))),(0,b.createElement)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end"},(0,b.createElement)(xe.Button,{variant:"secondary",onClick:n},(0,d.__)("Close","wordpress-seo")),(0,b.createElement)(xe.Button,{variant:"primary",onClick:o},(0,d.__)("Refresh page","wordpress-seo"))))};an.propTypes={invalidSubscriptions:S().arrayOf(S().string)};const nn=()=>{const e=(0,ge.useSelect)((e=>e(fa).selectLink("https://yoa.st/ai-common-errors")),[]),t=(0,ge.useSelect)((e=>e(fa).selectAdminLink("?page=wpseo_page_support")),[]);return(0,b.createElement)(xe.Alert,{variant:"error"},(0,b.createElement)("span",{className:"yst-block yst-font-medium"},(0,d.__)("Connection timeout","wordpress-seo")),(0,b.createElement)("p",{className:"yst-mt-2"},Ne((0,d.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ (0,d.__)("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,b.createElement)(Cr,{variant:"error",href:e}),a2:(0,b.createElement)(Cr,{variant:"error",href:t})})))},on=()=>{const e=(0,ge.useSelect)((e=>e(fa).selectAdminLink("?page=wpseo_page_support")),[]);return(0,b.createElement)(xe.Alert,{variant:"error"},(0,b.createElement)("span",{className:"yst-block yst-font-medium"},(0,d.__)("Usage policy violation","wordpress-seo")),(0,b.createElement)("p",{className:"yst-mt-2"},Ne((0,d.sprintf)( /* translators: %1$s, %2$s, %3$s, %4$s are anchor tags. * %5$s expands to OpenAI. */ (0,d.__)("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,b.createElement)(Cr,{variant:"error",href:"https://openai.com/policies/usage-policies"}),a2:(0,b.createElement)(Cr,{variant:"error",href:e})})))},ln=({errorMessage:e=""})=>{const t=(0,ge.useSelect)((e=>e(fa).selectAdminLink("?page=wpseo_page_support")),[]);return(0,b.createElement)(xe.Alert,{variant:"error"},(0,b.createElement)("span",{className:"yst-block yst-font-medium"},(0,d.__)("Something went wrong","wordpress-seo")),(0,b.createElement)("p",{className:"yst-mt-2"},(0,d.sprintf)(/* translators: %s is the error response of the request. */ (0,d.__)("The request came back with the following error: '%s'.","wordpress-seo"),e)),(0,b.createElement)("p",{className:"yst-mt-2"},Ne((0,d.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ (0,d.__)("Please try again later. If the issue persists, please %1$scontact our support team%2$s.","wordpress-seo"),"<a>","</a>"),{a:(0,b.createElement)(Cr,{variant:"error",href:t})})))};ln.propTypes={errorMessage:S().string};const cn=()=>{const e=(0,ge.useSelect)((e=>e(fa).selectAdminLink("plugins.php")),[]);return(0,b.createElement)(xe.Alert,{variant:"error"},(0,b.createElement)("span",{className:"yst-block yst-font-medium"},(0,d.__)("Something went wrong","wordpress-seo")),(0,b.createElement)("p",{className:"yst-mt-2"},Ne((0,d.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. */ (0,d.__)("The version of %1$s is outdated. Please upgrade %1$s %2$shere%3$s!","wordpress-seo"),"Yoast SEO Premium","<a>","</a>"),{a:(0,b.createElement)(Cr,{variant:"error",href:e})})))},dn=()=>{const e=(0,ge.useSelect)((e=>e(fa).selectLink("https://yoa.st/ai-common-errors")),[]),t=(0,ge.useSelect)((e=>e(fa).selectAdminLink("?page=wpseo_page_support")),[]);return(0,b.createElement)(xe.Alert,{variant:"error"},(0,b.createElement)("span",{className:"yst-block yst-font-medium"},(0,d.__)("Yoast AI cannot reach your site","wordpress-seo")),(0,b.createElement)("p",{className:"yst-mt-2"},Ne((0,d.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ (0,d.__)("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,b.createElement)(Cr,{variant:"error",href:e}),a2:(0,b.createElement)(Cr,{variant:"error",href:t})})))},un=({errorCode:e,errorIdentifier:t="",errorMessage:s=""})=>{switch(e){case 400:switch(t){case"SITE_UNREACHABLE":return(0,b.createElement)(dn,null);case"WP_HTTP_REQUEST_ERROR":return(0,b.createElement)(ln,{errorMessage:s});default:return(0,b.createElement)(en,null)}case 429:return(0,b.createElement)(rn,null);default:return(0,b.createElement)(en,null)}};un.propTypes={errorCode:S().number.isRequired,errorIdentifier:S().string,errorMessage:S().string};const pn=({currentSubscriptions:e,isSeoAnalysisActive:t=!0})=>{const{isPremium:s,usageCountStatus:r,usageCountError:a,isWooProductEntity:n,isWooSeoActive:o}=(0,ge.useSelect)((e=>{const t=e(fa);return{isPremium:t.getIsPremium(),usageCountStatus:e(ya).selectUsageCountStatus(),usageCountError:e(ya).selectUsageCountError(),isWooProductEntity:t.getIsWooProductEntity(),isWooSeoActive:t.getIsWooSeoActive()}}),[]),i=(0,v.useMemo)((()=>!e.wooCommerceSubscription&&n),[e.wooCommerceSubscription]),l=(0,v.useMemo)((()=>{const t=[];return!s&&!n||e.premiumSubscription||t.push("Yoast SEO Premium"),i&&o&&t.push("Yoast WooCommerce SEO"),t}),[s,e.premiumSubscription,i,o,n]);return l.length>0?(0,b.createElement)(an,{invalidSubscriptions:l}):t?r===La.error?(0,b.createElement)(un,{...a}):void 0:(0,b.createElement)(sn,null)};pn.propTypes={currentSubscriptions:S().object.isRequired,isSeoAnalysisActive:S().bool};const mn=({onStartGenerating:e})=>{const{termsOfServiceLink:t,privacyPolicyLink:s,learnMoreLink:r,imageLink:a,consentEndpoint:n}=(0,ge.useSelect)((e=>({termsOfServiceLink:e(fa).selectLink("https://yoa.st/ai-generator-terms-of-service"),privacyPolicyLink:e(fa).selectLink("https://yoa.st/ai-generator-privacy-policy"),learnMoreLink:e(fa).selectLink("https://yoa.st/ai-generator-learn-more"),imageLink:e(fa).selectImageLink("ai-consent.png"),consentEndpoint:e(ya).selectAiGeneratorConsentEndpoint()})),[]),{storeAiGeneratorConsent:o}=(0,ge.useDispatch)(ya),i=(0,v.useCallback)((async()=>{await o(!0,n),e()}),[o,e,n]);return(0,b.createElement)(ga,{termsOfServiceLink:t,privacyPolicyLink:s,learnMoreLink:r,imageLink:a,onGiveConsent:i})};mn.propTypes={onStartGenerating:S().func.isRequired};const hn=b.forwardRef((function(e,t){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"}))})),gn=b.forwardRef((function(e,t){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"}))})),yn=/(?<start><\/badge>|^(?!<badge>))(?<wrap>[\s\S]+?)(?<end><badge>|$)/g,fn=({total:e,current:t,onNavigate:s,disabled:r=!1,...a})=>(0,b.createElement)("div",{className:"yst-flex yst-justify-between yst-gap-x-2 yst-items-start"},(0,b.createElement)("p",{className:"yst-text-slate-500 yst-text-xxs yst-mt-1"},(0,d.__)("Text generated by AI may be offensive or inaccurate.","wordpress-seo")),e>1&&(0,b.createElement)(xe.Pagination,{className:"yst-shrink-0",current:t,total:e,onNavigate:s,disabled:r,variant:"text" /* translators: Hidden accessibility text. */,screenReaderTextPrevious:(0,d.__)("Previous","wordpress-seo") /* translators: Hidden accessibility text. */,screenReaderTextNext:(0,d.__)("Next","wordpress-seo"),...a})),wn=({height:e})=>{const[t,s]=(0,v.useState)(""),{onClose:r}=(0,xe.useModalContext)(),{editType:a,previewType:n,contentType:o}=Wa(),i=(()=>{const{editType:e,previewType:t}=Wa();let s="SEO";switch(t){case ba:s="social";break;case Ea:s="X"}switch(e){case va:return(0,d.sprintf)(/* translators: %s is the type of title. */ (0,d.__)("Generated %s titles","wordpress-seo"),s);case ka:return t===wa&&(s="meta"),(0,d.sprintf)(/* translators: %s is the type of description. */ (0,d.__)("Generated %s descriptions","wordpress-seo"),s)}})(),c=(()=>{const{editType:e,previewType:t}=Wa();let s="SEO";switch(t){case ba:s="social";break;case Ea:s="X"}switch(e){case va:return(0,d.sprintf)(/* translators: %s is the type of title. */ (0,d.__)("Apply %s title","wordpress-seo"),s);case ka:return t===wa&&(s="meta"),(0,d.sprintf)(/* translators: %s is the type of description. */ (0,d.__)("Apply %s description","wordpress-seo"),s)}})(),p=Ua(),{suggestions:m,fetchSuggestions:h,setSelectedSuggestion:g}=(()=>{const[e,t]=(0,v.useReducer)(Ka.reducer,Ka.getInitialState()),{editType:s,previewType:r,postType:a,contentType:n}=Wa(),o=(0,ge.useSelect)((e=>e(ya).selectPromptContent()),[]),{contentLocale:i,focusKeyphrase:l,isWooCommerceActive:c,isGutenberg:d,isElementor:p}=(0,ge.useSelect)((e=>({contentLocale:e(fa).getContentLocale(),focusKeyphrase:e(fa).getFocusKeyphrase(),isWooCommerceActive:e(fa).getIsWooCommerceActive(),isGutenberg:e(fa).getIsBlockEditor(),isElementor:e(fa).getIsElementorEditor()})),[]);let m,h=u.languageProcessing.helpers.processExactMatchRequest(l).keyphrase;h.length>191&&(h=h.slice(0,191)),m=p?"elementor":d?"gutenberg":"classic";const g=((e,t,s,r)=>{const a=e===ka?"meta-description":"seo-title";let n=((e,t)=>{if(e)switch(t){case"product":return"product-";case"product_cat":case"product_tag":return"product-taxonomy-"}return""})(t,s);return n&&t||r!==_a||(n="taxonomy-"),`${n}${a}`})(s,c,a,n);return{suggestions:e,fetchSuggestions:(0,v.useCallback)((async(e=!0)=>{t(Ka.actions.setLoading());const{status:s,payload:a}=await Fa({endpoint:"yoast/v1/ai_generator/get_suggestions/",canAbort:e,data:{type:g,prompt_content:o,focus_keyphrase:h,platform:za(r),language:Oa(i).replace("_","-"),editor:m}});switch(s){case Na:break;case Ta:t(Ka.actions.setError(a));break;case Ia:t(Ka.actions.setSuccess(a))}return s}),[t]),setSelectedSuggestion:(0,v.useCallback)((e=>t(Ka.actions.setSelected(e))),[t])}})(),y=(()=>{const{previewType:e}=Wa();switch(e){case ba:return Rn;case Ea:return To;default:return bn}})(),{addAppliedSuggestion:f,addUsageCount:w}=(0,ge.useDispatch)(ya),{isUsageCountLimitReached:E,isWooProductEntity:k,hasValidPremiumSubscription:x,hasValidWooSubscription:_}=(0,ge.useSelect)((e=>{const t=e(ya),s=e(fa);return{isUsageCountLimitReached:t.isUsageCountLimitReached(),isPremium:s.getIsPremium(),isWooProductEntity:s.getIsWooProductEntity(),isWooSeoActive:s.getIsWooSeoActive(),hasValidPremiumSubscription:t.selectPremiumSubscription(),hasValidWooSubscription:t.selectWooCommerceSubscription()}}),[]),S=(0,v.useMemo)((()=>m.status===La.loading||!(_||!E||!k)||!(x||!E)),[x,E,m.status,k,_]),R=(0,xe.usePrevious)(e),C=m.status===La.success?e:R,L=`calc(${0===C?"50%":C/2+"px"} - 40vh)`,[I,T]=(0,v.useState)(!1),N=(0,v.useCallback)((e=>{T(e.target.offsetHeight!==e.target.scrollHeight)}),[T]),P=Ha(N),M=(()=>{const{editType:e,previewType:t,contentType:s}=Wa(),r=(()=>{const{previewType:e}=Wa();return(0,v.useMemo)((()=>{switch(e){case wa:return()=>(0,ge.select)(fa).getSnippetEditorData().title;case ba:return(0,ge.select)(fa).getFacebookTitleOrFallback;case Ea:return(0,ge.select)(fa).getTwitterTitleOrFallback;default:return(0,l.constant)("")}}),[e])})(),a=(0,ge.useSelect)((s=>s(ya).selectAppliedSuggestionFor({editType:e,previewType:t})),[e,t]);return(0,v.useMemo)((()=>{let t=r();return e===ka?t:(a&&(t=t.replace(a,Ra[s])),((e,t)=>e.includes(Ra[t])?e:Ra[t])(t,s))}),[e,r])})(),A=(()=>{const e=(()=>{const{previewType:e}=Wa();return(0,v.useMemo)((()=>{switch(e){case wa:return()=>(0,ge.select)(fa).getSnippetEditorData().description;case ba:return(0,ge.select)(fa).getFacebookDescriptionOrFallback;case Ea:return(0,ge.select)(fa).getTwitterDescriptionOrFallback;default:return(0,l.constant)("")}}),[e])})();return(0,v.useMemo)(e,[e])})(),O=(()=>{const e=(0,ge.useSelect)((e=>e(fa).getReplaceVars()),[]),t=(0,v.useMemo)((()=>e.map($a)),[e]);return(0,v.useCallback)(((e,{key:s="value",overrides:r={},applyPluggable:a=!0,editType:n=va,contentType:o=xa}={})=>{for(const a of t)e=e.replace(new RegExp("%%"+(0,l.escapeRegExp)(a.name)+"%%","g"),(0,l.get)(r,a.name,a[s]));return o===_a&&(e=e.replace(" Archives","")),a?((e,t=va)=>{const s=tr({title:"",description:"",[t]:u.languageProcessing.stripSpaces(e)});return(0,l.get)(s,t,e)})(e,n):e}),[t])})(),F=(0,v.useMemo)((()=>a===va?{[Sa[o]]:m.selected}:{}),[a,o,m.selected]),q=(0,v.useMemo)((()=>O(M,{overrides:F,contentType:o})),[O,M,a,o,m.selected]),$=(0,v.useMemo)((()=>O(M,{overrides:{...F,sep:"",sitename:""},contentType:o})),[O,M,a,o,m.selected]),B=(0,v.useMemo)((()=>a===ka?m.selected:O(A,{editType:ka})),[O,A,a,m.selected]),D=(0,v.useCallback)((e=>O(M,{overrides:{[Sa[o]]:e},key:"badge",applyPluggable:!1,contentType:o})),[O,M,o]),{currentPage:W,setCurrentPage:U,isOnLastPage:H,totalPages:j,getItemsOnCurrentPage:K}=(({totalItems:e=0,perPage:t=5})=>{const[s,r]=(0,v.useState)(1),a=(0,v.useMemo)((()=>Math.ceil(e/t)),[e,t]),n=(0,v.useMemo)((()=>s*t),[s,t]),o=(0,v.useMemo)((()=>n-t),[n,t]),i=(0,v.useMemo)((()=>1===s),[s]),c=(0,v.useMemo)((()=>s===a),[s,a]),d=(0,v.useCallback)((()=>{s>1&&r(s-1)}),[s,r]),u=(0,v.useCallback)((()=>{s<a&&r(s+1)}),[s,r,a]),p=(0,v.useCallback)((e=>(0,l.slice)(e,o,n)),[o,n]);return{currentPage:s,setCurrentPage:r,totalPages:a,isOnFirstPage:i,isOnLastPage:c,previousPage:d,nextPage:u,firstOnPage:o,lastOnPage:n,getItemsOnCurrentPage:p}})({totalItems:m.status===La.loading||m.status===La.error?m.entities.length+5:m.entities.length,perPage:5}),z=(0,v.useMemo)((()=>(0,l.map)(K(m.entities),(e=>{let t=e;return a===va&&(t=D(e),t=t.replace(yn,((e,t,s,r,a,n,{start:o,wrap:i,end:l})=>{const c=i.trim();return 0===c.length?`${o}${i}${l}`:`${o}<span>${c}</span>${l}`})),t=Ne(t,{badge:(0,b.createElement)(xe.Badge,{className:"yst-me-2 last:yst-me-0",variant:"plain"}," "),span:(0,b.createElement)("span",{className:"yst-flex yst-items-center yst-me-2 last:yst-me-0"})})),{value:e,label:t}}))),[m.entities,K,a,D]),Y=(0,v.useMemo)((()=>m.status!==La.error||m.status===La.error&&!H),[m.status,H]),V=(0,v.useMemo)((()=>m.status===La.loading&&H),[m.status,H]),G=(0,v.useMemo)((()=>m.status===La.error&&H),[m.status,H]),Z=(0,v.useCallback)((()=>{S||(U(m.status===La.error?j:j+1),h().then((e=>{e===Ia&&w()})))}),[h,m.status,j,U,g,E]),Q=(0,v.useCallback)((()=>s("")),[s]),X=(()=>{const{editType:e}=Wa();switch(e){case va:return(()=>{const{previewType:e}=Wa(),{updateData:t,setFacebookPreviewTitle:s,setTwitterPreviewTitle:r}=(0,ge.useDispatch)(fa);return(0,v.useMemo)((()=>{switch(e){case wa:return e=>t({title:e});case ba:return s;case Ea:return r;default:return l.noop}}),[e,t,s,r])})();case ka:return(()=>{const{previewType:e}=Wa(),{updateData:t,setFacebookPreviewDescription:s,setTwitterPreviewDescription:r}=(0,ge.useDispatch)(fa);return(0,v.useMemo)((()=>{switch(e){case wa:return e=>t({description:e});case ba:return s;case Ea:return r;default:return l.noop}}),[e,t,s,r])})();default:return l.noop}})(),J=(0,v.useCallback)((()=>{const e=a===va?M.replace(new RegExp(Ra[o]+"( Archives)?"),m.selected):m.selected;X(e),f({editType:a,previewType:n,suggestion:m.selected}),r()}),[X,a,n,m.selected,M,r,f]);return((e,t=[])=>{const s=(0,v.useRef)(!1);(0,v.useEffect)((()=>{s.current||(s.current=!0,e().finally((()=>{s.current=!1})))}),[e,t])})((()=>""===t?h().then((e=>{s(e),e===Ia&&w()})):Promise.resolve()),[t,w,h]),t===Ta||m.status===La.error&&402===m.error.code?(0,b.createElement)("div",{className:"yst-flex yst-flex-col yst-space-y-6 yst-mt-6"},(0,b.createElement)(ko,{errorCode:m.error.code,errorIdentifier:m.error.errorIdentifier,invalidSubscriptions:m.error.missingLicenses,showActions:!0,onRetry:Q,errorMessage:m.error.message})):(0,b.createElement)(v.Fragment,null,(0,b.createElement)(xe.Modal.Container.Content,{ref:P,className:"yst-flex yst-flex-col yst-py-6 yst-space-y-2"},(0,b.createElement)(y,{title:q,description:B,status:m.status,titleForLength:$,showPreviewSkeleton:""===t,showLengthProgress:!V}),Y&&(V?(0,b.createElement)(Co,{idSuffix:p,suggestionClassNames:a===va?[["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,b.createElement)(v.Fragment,null,(0,b.createElement)("div",{className:"yst-flex yst-space-y-4"},(0,b.createElement)(xe.Label,{as:"span",className:"yst-flex-grow yst-cursor-default yst-mt-auto"},i),(0,b.createElement)(xe.Button,{variant:"secondary",size:"small",onClick:m.status===La.loading?l.noop:Z,isLoading:m.status===La.loading,disabled:S},m.status!==La.loading&&(0,b.createElement)(hn,{className:"yst--ms-1 yst-me-2 yst-h-4 yst-w-4 yst-text-gray-400"}),(0,d.__)("Generate 5 more","wordpress-seo"))),(0,b.createElement)(So,{idSuffix:p,suggestions:z,selected:m.selected,onChange:g}),(0,b.createElement)(fn,{current:W,total:j,onNavigate:U,disabled:m.status===La.loading||G}))),m.status===La.error&&H&&(0,b.createElement)(v.Fragment,null,(0,b.createElement)("div",{className:"yst-mt-8"}),(0,b.createElement)(ko,{errorCode:m.error.code,errorIdentifier:m.error.errorIdentifier,invalidSubscriptions:m.error.missingLicenses,errorMessage:m.error.message}),(0,b.createElement)(fn,{current:W,total:j,onNavigate:U,disabled:m.status===La.loading}))),(0,b.createElement)(xe.Modal.Container.Footer,null,I&&(0,b.createElement)("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,b.createElement)("hr",{className:"yst-mb-6 yst--mx-6"}),(0,b.createElement)("div",{className:"sm:yst-flex sm:yst-justify-end sm:yst-space-x-2 sm:rtl:yst-space-x-reverse"},(0,b.createElement)("div",{className:"yst-hidden sm:yst-inline"},(0,b.createElement)(xe.Button,{variant:"secondary",onClick:r},(0,d.__)("Close","wordpress-seo"))),(0,b.createElement)("div",{className:"yst-block sm:yst-inline"},(0,b.createElement)(xe.Button,{className:"yst-w-full sm:yst-w-auto",variant:"primary",onClick:J,disabled:""===m.selected||m.status===La.loading||G},(0,b.createElement)(gn,{className:"yst--ms-1 yst-me-1 yst-h-4 yst-w-4 yst-text-white"}),c)),(0,b.createElement)("div",{className:"yst-mt-3 sm:yst-hidden"},(0,b.createElement)(xe.Button,{variant:"secondary",onClick:r,className:"yst-w-full sm:yst-w-auto"},(0,d.__)("Close","wordpress-seo"))))),(0,b.createElement)(xe.Notifications,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all",style:{marginTop:L},position:"bottom-left"},m.status!==La.loading&&(0,b.createElement)(qo,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all"}),(m.status===La.success||m.status===La.loading)&&(0,b.createElement)(Io,null)))};wn.propTypes={height:S().number.isRequired};S().func.isRequired;const bn=({title:e,description:t,status:s,titleForLength:r,showPreviewSkeleton:a,showLengthProgress:n})=>{const o=(0,ge.useSelect)((e=>e(fa).getSnippetEditorMode()),[]),[i,l]=(0,v.useState)(o),{editType:c}=Wa(),u=Ua(),p=(({editType:e,title:t,description:s})=>{const r=(0,ge.useSelect)((e=>e(fa).getDateFromSettings()),[]),a=(0,ge.useSelect)((e=>e(fa).getContentLocale()),[]),n=(0,ge.useSelect)((e=>e(fa).isCornerstoneContent()),[]),o=(0,ge.useSelect)((e=>e(fa).getIsTerm()),[]);return(0,v.useMemo)((()=>e===ka?(0,Ya.getDescriptionProgress)(s,r,n,o,a):(0,Ya.getTitleProgress)(t)),[e,t,s,r,n,o,a])})({editType:c,title:r,description:t});return(0,b.createElement)(b.Fragment,null,(0,b.createElement)("div",{className:"yst-mb-2 lg:yst-flex"},(0,b.createElement)(xe.Label,{as:"span",className:"yst-flex-grow yst-cursor-default"},(0,d.__)("Google preview","wordpress-seo")),(0,b.createElement)(Sn,{mode:i,idSuffix:u,onChange:l,disabled:s===La.loading})),a?(0,b.createElement)(kn,null):(0,b.createElement)(vn,{mode:i,title:e,description:t}),(0,b.createElement)("div",{className:"yst-pt-4"},(0,b.createElement)(xe.Label,{as:"span",className:"yst-flex-grow yst-cursor-default"},c===va?(0,d.__)("SEO title width","wordpress-seo"):(0,d.__)("Meta description length","wordpress-seo")),(0,b.createElement)(xn,{className:"yst-mt-2",progress:n?p.actual:0,min:0,max:p.max,score:p.score})))};bn.propTypes={title:S().string.isRequired,description:S().string.isRequired,status:S().oneOf(Object.keys(La)).isRequired,titleForLength:S().string.isRequired,showPreviewSkeleton:S().bool.isRequired,showLengthProgress:S().bool.isRequired};const En=/mobi/i,vn=({mode:e,title:t,description:s})=>{var r,a;const n=(0,ge.useSelect)((e=>e(fa).getBaseUrlFromSettings()),[]),o=(0,ge.useSelect)((e=>e(fa).getSnippetEditorData().slug||""),[]),i=(0,ge.useSelect)((e=>e(fa).getDateFromSettings()),[]),c=(0,ge.useSelect)((e=>e(fa).getFocusKeyphrase()),[]),d=(0,ge.useSelect)((e=>e(fa).getSnippetEditorPreviewImageUrl()),[]),u=(0,ge.useSelect)((e=>e(fa).getSiteIconUrlFromSettings()),[]),p=(0,ge.useSelect)((e=>e(fa).getShoppingData()),[]),m=(0,ge.useSelect)((e=>e(fa).getSnippetEditorWordsToHighlight()),[]),h=(0,ge.useSelect)((e=>e(fa).getSiteName()),[]),g=(0,ge.useSelect)((e=>e(fa).getContentLocale()),[]),y=(0,v.useMemo)((()=>n+o),[n,o]),f=(0,v.useMemo)((()=>{var e,t;return En.test(null===(e=window)||void 0===e||null===(t=e.navigator)||void 0===t?void 0:t.userAgent)}),[null===(r=window)||void 0===r||null===(a=r.navigator)||void 0===a?void 0:a.userAgent]);return(0,b.createElement)("div",{className:`yst-bg-slate-200 yst--mx-6 ${e}${f?" yst-user-agent__mobile":""}`},(0,b.createElement)(Ya.SnippetPreview,{title:t,description:s,mode:e,url:y,keyword:c,date:i,faviconSrc:u,mobileImageSrc:d,wordsToHighlight:m,siteName:h,locale:g,shoppingData:p,onMouseUp:l.noop}))};vn.propTypes={mode:S().oneOf(Object.keys(Ca)).isRequired,title:S().string.isRequired,description:S().string.isRequired};const kn=()=>(0,b.createElement)("div",{className:"yst-max-w-[400px] yst-py-4 yst-px-3 yst-border yst-rounded-lg yst-w-full yst-mx-auto"},(0,b.createElement)("div",{className:"yst-flex yst-gap-x-3"},(0,b.createElement)(xe.SkeletonLoader,{className:"yst-flex-shrink-0 yst-h-7 yst-w-7 yst-rounded-full"}),(0,b.createElement)("div",{className:"yst-flex yst-flex-col yst-w-full yst-gap-y-1"},(0,b.createElement)(xe.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,b.createElement)(xe.SkeletonLoader,{className:"yst-h-2.5 yst-w-10/12"}))),(0,b.createElement)(xe.SkeletonLoader,{className:"yst-h-4 yst-w-full yst-mt-6 yst-mb-4"}),(0,b.createElement)(xe.SkeletonLoader,{className:"yst-h-3 yst-w-full"}),(0,b.createElement)(xe.SkeletonLoader,{className:"yst-h-3 yst-w-10/12 yst-mt-2.5"})),xn=({className:e="",progress:t,max:s,score:r})=>{const a=(0,v.useMemo)((()=>(e=>e>=7?"yst-score-good":e>=5?"yst-score-ok":"yst-score-bad")(r)),[r]);return(0,b.createElement)(xe.ProgressBar,{className:Vr()("yst-length-progress-bar",a,e),progress:t,min:0,max:s})};xn.propTypes={className:S().string,progress:S().number.isRequired,max:S().number.isRequired,score:S().number.isRequired};const Sn=({idSuffix:e,mode:t,onChange:s,disabled:r})=>{const a=(0,v.useCallback)((({target:e})=>e.checked&&s(e.value)),[s]);return(0,b.createElement)(xe.RadioGroup,{id:`yst-ai-mode__${e}`,className:"yst-ai-mode yst-pt-2 lg:yst-pt-0",disabled:r},(0,b.createElement)(xe.RadioGroup.Radio,{id:`yst-ai-mode__mobile__${e}`,name:`yst-ai-mode__${e}`,label:(0,d.__)("Mobile result","wordpress-seo"),value:Ca.mobile,checked:t===Ca.mobile,onChange:a,disabled:r}),(0,b.createElement)(xe.RadioGroup.Radio,{id:`yst-ai-mode__desktop__${e}`,name:`yst-ai-mode__${e}`,label:(0,d.__)("Desktop result","wordpress-seo"),value:Ca.desktop,checked:t===Ca.desktop,onChange:a,disabled:r}))};Sn.propTypes={idSuffix:S().string.isRequired,mode:S().oneOf(Object.keys(Ca)).isRequired,onChange:S().func.isRequired,disabled:S().bool.isRequired};const Rn=({title:e,description:t,showPreviewSkeleton:s})=>(0,b.createElement)("div",null,(0,b.createElement)("div",{className:"yst-flex yst-mb-6"},(0,b.createElement)(xe.Label,{as:"span",className:"yst-flex-grow yst-cursor-default"},(0,d.__)("Social preview","wordpress-seo"))),s?(0,b.createElement)(Eo,null):(0,b.createElement)(bo,{title:e,description:t}));Rn.propTypes={title:S().string.isRequired,description:S().string.isRequired,showPreviewSkeleton:S().bool.isRequired};const Cn=x().p` color: #606770; flex-shrink: 0; font-size: 12px; line-height: 16px; overflow: hidden; padding: 0; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; margin: 0; position: ${e=>"landscape"===e.mode?"relative":"static"}; `,Ln=e=>{const{siteUrl:t}=e;return(0,b.createElement)(b.Fragment,null,(0,b.createElement)("span",{className:"screen-reader-text"},t),(0,b.createElement)(Cn,{"aria-hidden":"true"},(0,b.createElement)("span",null,t)))};Ln.propTypes={siteUrl:S().string.isRequired};const In=Ln,Tn=x().img` && { max-width: ${e=>e.width}px; height: ${e=>e.height}px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); max-width: none; } `,Nn=x().img` && { height: 100%; position: absolute; width: 100%; object-fit: cover; } `,Pn=x().div` padding-bottom: ${e=>e.aspectRatio}%; `,Mn=({imageProps:e,width:t,height:s,imageMode:r="landscape"})=>"landscape"===r?(0,b.createElement)(Pn,{aspectRatio:e.aspectRatio},(0,b.createElement)(Nn,{src:e.src,alt:e.alt})):(0,b.createElement)(Tn,{src:e.src,alt:e.alt,width:t,height:s,imageProperties:e});function An(e,t,s){return"landscape"===s?{widthRatio:t.width/e.landscapeWidth,heightRatio:t.height/e.landscapeHeight}:"portrait"===s?{widthRatio:t.width/e.portraitWidth,heightRatio:t.height/e.portraitHeight}:{widthRatio:t.width/e.squareWidth,heightRatio:t.height/e.squareHeight}}function On(e,t){return t.widthRatio<=t.heightRatio?{width:Math.round(e.width/t.widthRatio),height:Math.round(e.height/t.widthRatio)}:{width:Math.round(e.width/t.heightRatio),height:Math.round(e.height/t.heightRatio)}}async function Fn(e,t,s=!1){const r=await function(e){return new Promise(((t,s)=>{const r=new Image;r.onload=()=>{t({width:r.width,height:r.height})},r.onerror=s,r.src=e}))}(e);let a=s?"landscape":"square";"Facebook"===t&&(a=(0,ee.determineFacebookImageMode)(r));const n=function(e){return"Twitter"===e?ee.TWITTER_IMAGE_SIZES:ee.FACEBOOK_IMAGE_SIZES}(t),o=function(e,t,s){return"square"===s&&t.width===t.height?{width:e.squareWidth,height:e.squareHeight}:On(t,An(e,t,s))}(n,r,a);return{mode:a,height:o.height,width:o.width}}async function qn(e,t,s=!1){try{return{imageProperties:await Fn(e,t,s),status:"loaded"}}catch(e){return{imageProperties:null,status:"errored"}}}Mn.propTypes={imageProps:S().shape({src:S().string.isRequired,alt:S().string.isRequired,aspectRatio:S().number.isRequired}).isRequired,width:S().number.isRequired,height:S().number.isRequired,imageMode:S().string};const $n=x().div` position: relative; ${e=>"landscape"===e.mode?`max-width: ${e.dimensions.width}`:`min-width: ${e.dimensions.width}; height: ${e.dimensions.height}`}; overflow: hidden; background-color: ${L.colors.$color_white}; `,Bn=x().div` box-sizing: border-box; max-width: ${ee.FACEBOOK_IMAGE_SIZES.landscapeWidth}px; height: ${ee.FACEBOOK_IMAGE_SIZES.landscapeHeight}px; background-color: ${L.colors.$color_grey}; border-style: dashed; border-width: 1px; // We're not using standard colors to increase contrast for accessibility. color: #006DAC; // We're not using standard colors to increase contrast for accessibility. background-color: #f1f1f1; display: flex; justify-content: center; align-items: center; text-decoration: underline; font-size: 14px; cursor: pointer; `;class Dn extends b.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 qn(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:ee.FACEBOOK_IMAGE_SIZES.squareHeight+"px",width:ee.FACEBOOK_IMAGE_SIZES.squareWidth+"px"};case"portrait":return{height:ee.FACEBOOK_IMAGE_SIZES.portraitHeight+"px",width:ee.FACEBOOK_IMAGE_SIZES.portraitWidth+"px"};case"landscape":return{height:ee.FACEBOOK_IMAGE_SIZES.landscapeHeight+"px",width:ee.FACEBOOK_IMAGE_SIZES.landscapeWidth+"px"}}}render(){const{imageProperties:e,status:t}=this.state;if("loading"===t||""===this.props.src||"errored"===t)return(0,b.createElement)(Bn,{onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave},(0,d.__)("Select image","wordpress-seo"));const s=this.retrieveContainerDimensions(e.mode);return(0,b.createElement)($n,{mode:e.mode,dimensions:s,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,onClick:this.props.onImageClick},(0,b.createElement)(Mn,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:ee.FACEBOOK_IMAGE_SIZES.aspectRatio},width:e.width,height:e.height,imageMode:e.mode}))}}Dn.propTypes={src:S().string,alt:S().string,onImageLoaded:S().func,onImageClick:S().func,onMouseEnter:S().func,onMouseLeave:S().func},Dn.defaultProps={src:"",alt:"",onImageLoaded:l.noop,onImageClick:l.noop,onMouseEnter:l.noop,onMouseLeave:l.noop};const Wn=Dn,Un=x().span` line-height: ${20}px; min-height : ${20}px; color: #1d2129; font-weight: 600; overflow: hidden; font-size: 16px; margin: 3px 0 0; letter-spacing: normal; white-space: normal; flex-shrink: 0; cursor: pointer; display: -webkit-box; -webkit-line-clamp: ${e=>e.lineCount}; -webkit-box-orient: vertical; overflow: hidden; `,Hn=x().p` line-height: ${16}px; min-height : ${16}px; color: #606770; font-size: 14px; padding: 0; text-overflow: ellipsis; margin: 3px 0 0 0; display: -webkit-box; cursor: pointer; -webkit-line-clamp: ${e=>e.lineCount}; -webkit-box-orient: vertical; overflow: hidden; @media all and ( max-width: ${e=>e.maxWidth} ) { display: none; } `,jn=e=>{switch(e){case"landscape":return"527px";case"square":case"portrait":return"369px";default:return"476px"}},Kn=x().div` box-sizing: border-box; display: flex; flex-direction: ${e=>"landscape"===e.mode?"column":"row"}; background-color: #f2f3f5; max-width: 527px; `,zn=x().div` box-sizing: border-box; background-color: #f2f3f5; margin: 0; padding: 10px 12px; position: relative; border-bottom: ${e=>"landscape"===e.mode?"":"1px solid #dddfe2"}; border-top: ${e=>"landscape"===e.mode?"":"1px solid #dddfe2"}; border-right: ${e=>"landscape"===e.mode?"":"1px solid #dddfe2"}; border: ${e=>"landscape"===e.mode?"1px solid #dddfe2":""}; display: flex; flex-direction: column; flex-grow: 1; justify-content: ${e=>"landscape"===e.mode?"flex-start":"center"}; font-size: 12px; overflow: hidden; `;class Yn extends b.Component{constructor(e){super(e),this.state={imageMode:null,maxLineCount:0,descriptionLineCount:0},this.facebookTitleRef=E().createRef(),this.onImageLoaded=this.onImageLoaded.bind(this),this.onImageEnter=this.props.onMouseHover.bind(this,"image"),this.onTitleEnter=this.props.onMouseHover.bind(this,"title"),this.onDescriptionEnter=this.props.onMouseHover.bind(this,"description"),this.onLeave=this.props.onMouseHover.bind(this,""),this.onSelectTitle=this.props.onSelect.bind(this,"title"),this.onSelectDescription=this.props.onSelect.bind(this,"description")}onImageLoaded(e){this.setState({imageMode:e})}getTitleLineCount(){return this.facebookTitleRef.current.offsetHeight/20}maybeSetMaxLineCount(){const{imageMode:e,maxLineCount:t}=this.state,s="landscape"===e?2:5;s!==t&&this.setState({maxLineCount:s})}maybeSetDescriptionLineCount(){const{descriptionLineCount:e,maxLineCount:t,imageMode:s}=this.state,r=this.getTitleLineCount();let a=t-r;"portrait"===s&&(a=5===r?0:4),a!==e&&this.setState({descriptionLineCount:a})}componentDidUpdate(){this.maybeSetMaxLineCount(),this.maybeSetDescriptionLineCount()}render(){const{imageMode:e,maxLineCount:t,descriptionLineCount:s}=this.state;return(0,b.createElement)(Kn,{id:"facebookPreview",mode:e},(0,b.createElement)(Wn,{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,b.createElement)(zn,{mode:e},(0,b.createElement)(In,{siteUrl:this.props.siteUrl,mode:e}),(0,b.createElement)(Un,{ref:this.facebookTitleRef,onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle,lineCount:t},this.props.title),s>0&&(0,b.createElement)(Hn,{maxWidth:jn(e),onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription,lineCount:s},this.props.description)))}}Yn.propTypes={siteUrl:S().string.isRequired,title:S().string.isRequired,description:S().string,imageUrl:S().string,imageFallbackUrl:S().string,alt:S().string,onSelect:S().func,onImageClick:S().func,onMouseHover:S().func},Yn.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{}};const Vn=Yn,Gn=x().div` text-transform: lowercase; color: rgb(83, 100, 113); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; fill: currentcolor; display: flex; flex-direction: row; align-items: flex-end; `,Zn=e=>(0,b.createElement)(Gn,null,(0,b.createElement)("span",null,e.siteUrl));Zn.propTypes={siteUrl:S().string.isRequired};const Qn=Zn,Xn=(e,t=!0)=>e?`\n\t\t\tmax-width: ${ee.TWITTER_IMAGE_SIZES.landscapeWidth}px;\n\t\t\t${t?"border-bottom: 1px solid #E1E8ED;":""}\n\t\t\tborder-radius: 14px 14px 0 0;\n\t\t\t`:`\n\t\twidth: ${ee.TWITTER_IMAGE_SIZES.squareWidth}px;\n\t\t${t?"border-right: 1px solid #E1E8ED;":""}\n\t\tborder-radius: 14px 0 0 14px;\n\t\t`,Jn=x().div` position: relative; box-sizing: content-box; overflow: hidden; background-color: #e1e8ed; flex-shrink: 0; ${e=>Xn(e.isLarge)} `,eo=x().div` display: flex; justify-content: center; align-items: center; box-sizing: border-box; max-width: 100%; margin: 0; padding: 1em; text-align: center; font-size: 1rem; ${e=>Xn(e.isLarge,!1)} `,to=x()(eo)` ${e=>e.isLarge&&`height: ${ee.TWITTER_IMAGE_SIZES.landscapeHeight}px;`} border-top-left-radius: 14px; ${e=>e.isLarge?"border-top-right-radius":"border-bottom-left-radius"}: 14px; border-style: dashed; border-width: 1px; // We're not using standard colors to increase contrast for accessibility. color: #006DAC; // We're not using standard colors to increase contrast for accessibility. background-color: #f1f1f1; text-decoration: underline; font-size: 14px; cursor: pointer; `;class so extends E().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 qn(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,b.createElement)(to,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave},(0,d.__)("Select image","wordpress-seo")):(0,b.createElement)(Jn,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave},(0,b.createElement)(Mn,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:ee.TWITTER_IMAGE_SIZES.aspectRatio},width:t.width,height:t.height,imageMode:t.mode}))}}so.propTypes={isLarge:S().bool.isRequired,src:S().string,alt:S().string,onImageClick:S().func,onMouseEnter:S().func,onMouseLeave:S().func},so.defaultProps={src:"",alt:"",onMouseEnter:l.noop,onImageClick:l.noop,onMouseLeave:l.noop};const ro=x().div` display: flex; flex-direction: column; padding: 12px; justify-content: center; margin: 0; box-sizing: border-box; flex: auto; min-width: 0px; gap:2px; > * { line-height:20px; min-height:20px; font-size:15px; } `,ao=e=>(0,b.createElement)(ro,null,e.children);ao.propTypes={children:S().array.isRequired};const no=ao,oo=x().p` white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; color: rgb(15, 20, 25); cursor: pointer; `,io=x().p` max-height: 55px; overflow: hidden; text-overflow: ellipsis; margin: 0; color: rgb(83, 100, 113); display: -webkit-box; cursor: pointer; -webkit-line-clamp: 2; -webkit-box-orient: vertical; @media all and ( max-width: ${ee.TWITTER_IMAGE_SIZES.landscapeWidth}px ) { display: none; } `,lo=x().div` font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif; font-size: 15px; font-weight: 400; line-height: 20px; max-width: 507px; border: 1px solid #E1E8ED; box-sizing: border-box; border-radius: 14px; color: #292F33; background: #FFFFFF; text-overflow: ellipsis; display: flex; &:hover { background: #f5f8fa; border: 1px solid rgba(136,153,166,.5); } `,co=x()(lo)` flex-direction: column; max-height: 370px; `,uo=x()(lo)` flex-direction: row; height: 125px; `;class po extends b.Component{constructor(e){super(e),this.onImageEnter=this.props.onMouseHover.bind(this,"image"),this.onTitleEnter=this.props.onMouseHover.bind(this,"title"),this.onDescriptionEnter=this.props.onMouseHover.bind(this,"description"),this.onLeave=this.props.onMouseHover.bind(this,""),this.onSelectTitle=this.props.onSelect.bind(this,"title"),this.onSelectDescription=this.props.onSelect.bind(this,"description")}render(){const{isLarge:e,imageUrl:t,imageFallbackUrl:s,alt:r,title:a,description:n,siteUrl:o}=this.props,i=e?co:uo;return(0,b.createElement)(i,{id:"twitterPreview"},(0,b.createElement)(so,{src:t||s,alt:r,isLarge:e,onImageClick:this.props.onImageClick,onMouseEnter:this.onImageEnter,onMouseLeave:this.onLeave}),(0,b.createElement)(no,null,(0,b.createElement)(Qn,{siteUrl:o}),(0,b.createElement)(oo,{onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle},a),(0,b.createElement)(io,{onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription},n)))}}po.propTypes={siteUrl:S().string.isRequired,title:S().string.isRequired,description:S().string,isLarge:S().bool,imageUrl:S().string,imageFallbackUrl:S().string,alt:S().string,onSelect:S().func,onImageClick:S().func,onMouseHover:S().func},po.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{},isLarge:!0};const mo=po,ho=window.yoast.replacementVariableEditor;class go extends b.Component{constructor(e){super(e),this.state={activeField:"",hoveredField:""},this.SocialPreview="Social"===e.socialMediumName?Vn:mo,this.setHoveredField=this.setHoveredField.bind(this),this.setActiveField=this.setActiveField.bind(this),this.setEditorRef=this.setEditorRef.bind(this),this.setEditorFocus=this.setEditorFocus.bind(this)}setHoveredField(e){e!==this.state.hoveredField&&this.setState({hoveredField:e})}setActiveField(e){e!==this.state.activeField&&this.setState({activeField:e},(()=>this.setEditorFocus(e)))}setEditorFocus(e){switch(e){case"title":this.titleEditorRef.focus();break;case"description":this.descriptionEditorRef.focus()}}setEditorRef(e,t){switch(e){case"title":this.titleEditorRef=t;break;case"description":this.descriptionEditorRef=t}}render(){const{onDescriptionChange:e,onTitleChange:t,onSelectImageClick:s,onRemoveImageClick:r,socialMediumName:a,imageWarnings:n,siteUrl:o,description:i,descriptionInputPlaceholder:l,descriptionPreviewFallback:c,imageUrl:d,imageFallbackUrl:u,alt:p,title:m,titleInputPlaceholder:h,titlePreviewFallback:g,replacementVariables:y,recommendedReplacementVariables:f,applyReplacementVariables:w,onReplacementVariableSearchChange:v,isPremium:k,isLarge:x,socialPreviewLabel:_,idSuffix:S,activeMetaTabId:C}=this.props,L=w({title:m||g,description:i||c});return(0,b.createElement)(E().Fragment,null,_&&(0,b.createElement)(R.SimulatedLabel,null,_),(0,b.createElement)(this.SocialPreview,{onMouseHover:this.setHoveredField,onSelect:this.setActiveField,onImageClick:s,siteUrl:o,title:L.title,description:L.description,imageUrl:d,imageFallbackUrl:u,alt:p,isLarge:x,activeMetaTabId:C}),(0,b.createElement)(ee.SocialMetadataPreviewForm,{onDescriptionChange:e,socialMediumName:a,title:m,titleInputPlaceholder:h,onRemoveImageClick:r,imageSelected:!!d,imageUrl:d,imageFallbackUrl:u,onTitleChange:t,onSelectImageClick:s,description:i,descriptionInputPlaceholder:l,imageWarnings:n,replacementVariables:y,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}))}}go.propTypes={title:S().string.isRequired,onTitleChange:S().func.isRequired,description:S().string.isRequired,onDescriptionChange:S().func.isRequired,imageUrl:S().string.isRequired,imageFallbackUrl:S().string.isRequired,onSelectImageClick:S().func.isRequired,onRemoveImageClick:S().func.isRequired,socialMediumName:S().string.isRequired,alt:S().string,isPremium:S().bool,imageWarnings:S().array,isLarge:S().bool,siteUrl:S().string,descriptionInputPlaceholder:S().string,titleInputPlaceholder:S().string,descriptionPreviewFallback:S().string,titlePreviewFallback:S().string,replacementVariables:ho.replacementVariablesShape,recommendedReplacementVariables:ho.recommendedReplacementVariablesShape,applyReplacementVariables:S().func,onReplacementVariableSearchChange:S().func,socialPreviewLabel:S().string,idSuffix:S().string,activeMetaTabId:S().string},go.defaultProps={imageWarnings:[],recommendedReplacementVariables:[],replacementVariables:[],isPremium:!1,isLarge:!0,siteUrl:"",descriptionInputPlaceholder:"",titleInputPlaceholder:"",descriptionPreviewFallback:"",titlePreviewFallback:"",alt:"",applyReplacementVariables:e=>e,onReplacementVariableSearchChange:null,socialPreviewLabel:"",idSuffix:"",activeMetaTabId:""};const yo={},fo=(e,t,{log:s=console.warn}={})=>{yo[e]||(yo[e]=!0,s(t))},wo=(e,t=l.noop)=>{const s={};for(const r in e)Object.hasOwn(e,r)&&Object.defineProperty(s,r,{set:s=>{e[r]=s,t("set",r,s)},get:()=>(t("get",r),e[r])});return s};wo({squareWidth:125,squareHeight:125,landscapeWidth:506,landscapeHeight:265,aspectRatio:50.2},((e,t)=>fo(`@yoast/social-metadata-previews/TWITTER_IMAGE_SIZES/${e}/${t}`,`[@yoast/social-metadata-previews] "TWITTER_IMAGE_SIZES.${t}" is deprecated and will be removed in the future, please use this from @yoast/social-metadata-forms instead.`))),wo({squareWidth:158,squareHeight:158,landscapeWidth:527,landscapeHeight:273,portraitWidth:158,portraitHeight:237,aspectRatio:52.2,largeThreshold:{width:446,height:233}},((e,t)=>fo(`@yoast/social-metadata-previews/FACEBOOK_IMAGE_SIZES/${e}/${t}`,`[@yoast/social-metadata-previews] "FACEBOOK_IMAGE_SIZES.${t}" is deprecated and will be removed in the future, please use this from @yoast/social-metadata-forms instead.`)));const bo=({title:e,description:t})=>{const s=(0,ge.useSelect)((e=>e(fa).getSiteUrl()),[]),r=(0,ge.useSelect)((e=>e(fa).getFacebookImageUrl()),[]),a=(0,ge.useSelect)((e=>e(fa).getEditorDataImageFallback()),[]),n=(0,ge.useSelect)((e=>e(fa).getFacebookAltText()),[]);return(0,b.createElement)("div",{className:"yst-bg-slate-200 yst-p-2 yst--mx-6 yst-mx-auto"},(0,b.createElement)(Vn,{title:e,description:t,siteUrl:s,imageUrl:r,imageFallbackUrl:a,alt:n,onSelect:l.noop,onImageClick:l.noop,onMouseHover:l.noop}))};bo.propTypes={title:S().string.isRequired,description:S().string.isRequired};const Eo=()=>(0,b.createElement)("div",{className:"yst-flex yst-flex-col yst-w-[527px] yst-border yst-mx-auto"},(0,b.createElement)(xe.SkeletonLoader,{className:"yst-h-[273px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,b.createElement)("div",{className:"yst-w-full yst-p-4 yst-space-y-1"},(0,b.createElement)(xe.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,b.createElement)(xe.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,b.createElement)(xe.SkeletonLoader,{className:"yst-h-3 yst-w-full"}))),vo=({children:e,onRetry:t})=>{const{onClose:s}=(0,xe.useModalContext)();return(0,b.createElement)(v.Fragment,null,e,(0,b.createElement)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end"},(0,b.createElement)(xe.Button,{variant:"secondary",onClick:s},(0,d.__)("Close","wordpress-seo")),(0,b.createElement)(xe.Button,{variant:"primary",onClick:t},(0,d.__)("Try again","wordpress-seo"))))};vo.propTypes={children:S().node.isRequired,onRetry:S().func.isRequired};const ko=({errorCode:e,errorIdentifier:t,invalidSubscriptions:s=[],showActions:r=!1,onRetry:a=l.noop,errorMessage:n=""})=>{switch(e){case 400:switch(t){case"AI_CONTENT_FILTER":return(0,b.createElement)(on,null);case"NOT_ENOUGH_CONTENT":return(0,b.createElement)(tn,null);case"SITE_UNREACHABLE":return(0,b.createElement)(dn,null);case"WP_HTTP_REQUEST_ERROR":return r?(0,b.createElement)(vo,{onRetry:a},(0,b.createElement)(ln,{errorMessage:n})):(0,b.createElement)(ln,{errorMessage:n});default:return r?(0,b.createElement)(vo,{onRetry:a},(0,b.createElement)(en,null)):(0,b.createElement)(en,null)}case 402:return(0,b.createElement)(an,{invalidSubscriptions:s});case 408:return r?(0,b.createElement)(vo,{onRetry:a},(0,b.createElement)(nn,null)):(0,b.createElement)(nn,null);case 429:return"USAGE_LIMIT_REACHED"===t?(0,b.createElement)(an,{invalidSubscriptions:s}):(0,b.createElement)(rn,null);case 410:return(0,b.createElement)(cn,null);default:return r?(0,b.createElement)(vo,{onRetry:a},(0,b.createElement)(en,null)):(0,b.createElement)(en,null)}};ko.propTypes={errorCode:S().number.isRequired,errorIdentifier:S().string.isRequired,invalidSubscriptions:S().array,showActions:S().bool,onRetry:S().func,errorMessage:S().string};const xo=S().shape({value:S().string.isRequired,label:S().node.isRequired}),_o=({id:e,name:t,suggestion:s,isChecked:r,onChange:a})=>{const n=(0,v.useCallback)((()=>a(s.value)),[s,a]);return(0,b.createElement)("label",{htmlFor:e,className:Vr()("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")},(0,b.createElement)("input",{type:"radio",id:e,name:t,className:"yst-radio__input",value:s.value,checked:r,onChange:n}),(0,b.createElement)("div",{className:Vr()("yst-label yst-radio__label yst-flex yst-flex-wrap yst-items-center",!r&&"yst-text-slate-600")},s.label))};_o.propTypes={id:S().string.isRequired,name:S().string.isRequired,suggestion:xo.isRequired,isChecked:S().bool.isRequired,onChange:S().func.isRequired};const So=({idSuffix:e,suggestions:t,selected:s,onChange:r})=>(0,b.createElement)("div",null,(0,b.createElement)(xe.RadioGroup,{className:"yst-suggestions-radio-group yst-flex yst-flex-col",id:`yst-ai-suggestions-radio-group__${e}`},t.map(((t,a)=>(0,b.createElement)(_o,{key:`yst-ai-suggestions-radio-${e}__${a}`,id:`yst-ai-suggestions-radio-${e}__${a}`,name:`ai-suggestion__${e}`,isChecked:t.value===s,onChange:r,suggestion:t})))));So.propTypes={idSuffix:S().string.isRequired,suggestions:S().arrayOf(xo).isRequired,selected:S().string.isRequired,onChange:S().func.isRequired};const Ro=[["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"]],Co=({suggestionClassNames:e=Ro})=>(0,b.createElement)("div",{className:"yst-flex yst-flex-col yst--space-y-[1px]"},e.map(((e,t)=>(0,b.createElement)("div",{key:`yst-ai-suggestion-radio-skeleton__${t}`,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"},(0,b.createElement)("input",{type:"radio",disabled:!0,className:"yst-my-0.5"}),(0,b.createElement)("div",{className:"yst-flex yst-flex-col yst-w-full"},e.map(((e,s)=>(0,b.createElement)(xe.SkeletonLoader,{key:`yst-ai-suggestion-radio-skeleton-${t}__${s}`,className:e}))))))));Co.propTypes={suggestionClassNames:S().arrayOf(S().arrayOf(S().string))};const Lo="ai_generator_tip_notification",Io=()=>{const e=(0,ge.useSelect)((e=>e(fa).isAlertDismissed(Lo)),[]),t=(0,ge.useSelect)((e=>e(fa).getEditorDataContent()),[]),s=(0,ge.useSelect)((e=>e(fa).getIsWooProductEntity()),[]),[r,,,a]=(0,xe.useToggleState)(!1),{editType:n,contentType:o}=Wa(),{dismissAlert:i}=(0,ge.useDispatch)(fa),l=(0,v.useCallback)((()=>{i(Lo)}),[i]),c=(0,v.useMemo)((()=>n===ka?(0,d.__)("%1$sTip%2$s: Improve the accuracy of your generated AI descriptions by writing more content in your page.","wordpress-seo"):(0,d.__)("%1$sTip%2$s: Improve the accuracy of your generated AI titles by writing more content in your page.","wordpress-seo") /* translators: %1$s and %2$s expand to opening and closing of a span in order to emphasise the word. */),[n]),u=(0,v.useMemo)((()=>((e,t)=>e||t===_a?150:300)(s,o)),[o,s]);return e||r||t.length>u?null:(0,b.createElement)(xe.Notifications.Notification,{id:"ai-generator-content-tip",variant:"info",dismissScreenReaderLabel:(0,d.__)("Dismiss","wordpress-seo")},Ne((0,d.sprintf)(c,"<span>","</span>"),{span:(0,b.createElement)("span",{className:"yst-font-medium yst-text-slate-800"})}),(0,b.createElement)("div",{className:"yst-flex yst-mt-3 yst--ms-3 yst-gap-1"},(0,b.createElement)(xe.Button,{type:"button",variant:"tertiary",onClick:l},(0,d.__)("Don’t show again","wordpress-seo")),(0,b.createElement)(xe.Button,{type:"button",variant:"tertiary",className:"yst-text-slate-800",onClick:a},(0,d.__)("Dismiss","wordpress-seo"))))},To=({title:e,description:t,showPreviewSkeleton:s})=>(0,b.createElement)("div",null,(0,b.createElement)("div",{className:"yst-flex yst-mb-6"},(0,b.createElement)(xe.Label,{as:"span",className:"yst-flex-grow yst-cursor-default"},(0,d.__)("X preview","wordpress-seo"))),s?(0,b.createElement)(Po,null):(0,b.createElement)(No,{title:e,description:t}));To.propTypes={title:S().string.isRequired,description:S().string.isRequired,showPreviewSkeleton:S().bool.isRequired};const No=({title:e,description:t})=>{const s=(0,ge.useSelect)((e=>e(fa).getSiteUrl()),[]),r=(0,ge.useSelect)((e=>e(fa).getTwitterImageUrl()),[]),a=(0,ge.useSelect)((e=>e(fa).getFacebookImageUrl()),[]),n=(0,ge.useSelect)((e=>e(fa).getEditorDataImageFallback()),[]),o=(0,ge.useSelect)((e=>e(fa).getTwitterImageType()),[]),i=(0,ge.useSelect)((e=>e(fa).getTwitterAltText()),[]);return(0,b.createElement)("div",{className:"yst-bg-slate-200 yst-p-2 yst--mx-6"},(0,b.createElement)(mo,{title:e,description:t,siteUrl:s,imageUrl:r,imageFallbackUrl:a||n,isLarge:"summary"!==o,alt:i,onSelect:l.noop,onImageClick:l.noop,onMouseHover:l.noop}))};No.propTypes={title:S().string.isRequired,description:S().string.isRequired};const Po=()=>(0,b.createElement)("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"},(0,b.createElement)(xe.SkeletonLoader,{className:"yst-h-[265px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,b.createElement)("div",{className:"yst-w-full yst-p-4 yst-space-y-1"},(0,b.createElement)(xe.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,b.createElement)(xe.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,b.createElement)(xe.SkeletonLoader,{className:"yst-h-3 yst-w-full"}))),Mo="yst-mt-1 yst-mb-3",Ao="yst-flex yst-justify-end yst--me-8 yst-gap-3 yst--ms-2",Oo=({onClose:e})=>(0,b.createElement)(b.Fragment,null,(0,b.createElement)("p",{className:Mo},(0,d.__)("As long as this is a beta feature, you get unlimited sparks.","wordpress-seo")),(0,b.createElement)("div",{className:Ao},(0,b.createElement)(xe.Button,{type:"button",variant:"primary",size:"small",onClick:e},(0,d.__)("Got it!","wordpress-seo")))),Fo=({onClose:e,upsellLink:t,isWooProductEntity:s=!1,ctbId:r="f6a84663-465f-4cb5-8ba5-f7a6d72224b2"})=>{const a=(0,xe.useSvgAria)();return(0,b.createElement)(b.Fragment,null,(0,b.createElement)("p",{className:Mo},(0,d.sprintf)(/* translators: %s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ (0,d.__)("Keep the momentum going, unlock unlimited sparks with %s!","wordpress-seo"),s?"Yoast WooCommerce SEO":"Yoast SEO Premium")),(0,b.createElement)("div",{className:Ao},(0,b.createElement)(xe.Button,{type:"button",variant:"tertiary",size:"small",onClick:e},(0,d.__)("Close","wordpress-seo")),(0,b.createElement)(xe.Button,{as:"a",size:"small",variant:"upsell",href:t,target:"_blank",rel:"noopener noreferrer","data-action":"load-nfd-ctb","data-ctb-id":r},(0,b.createElement)(or,{className:"yst-w-4 yst-h-4 yst--ms-1 yst-me-2 yst-shrink-0",...a}),(0,d.sprintf)(/* translators: %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ (0,d.__)("Unlock with %1$s","wordpress-seo"),s?"Yoast WooCommerce SEO":"Yoast SEO Premium"),(0,b.createElement)("span",{className:"yst-sr-only"},/* translators: Hidden accessibility text. */ (0,d.__)("(Opens in a new browser tab)","wordpress-seo")))))},qo=({className:e=""})=>{const{isUsageCountLimitReached:t,usageCount:s,usageCountLimit:r,premiumUpsellLink:a,wooUpsellLink:n,isWooProductEntity:o,hasValidPremiumSubscription:i,hasValidWooSubscription:l}=(0,ge.useSelect)((e=>{const t=e(ya),s=e(fa);return{isUsageCountLimitReached:t.isUsageCountLimitReached(),usageCount:t.selectUsageCount(),usageCountLimit:t.selectUsageCountLimit(),premiumUpsellLink:s.selectLink("https://yoa.st/ai-toast-out-of-free-sparks"),wooUpsellLink:s.selectLink("https://yoa.st/ai-toast-out-of-free-sparks-woo"),isWooProductEntity:s.getIsWooProductEntity(),hasValidPremiumSubscription:t.selectPremiumSubscription(),hasValidWooSubscription:t.selectWooCommerceSubscription()}}),[]),c=(0,v.useMemo)((()=>i&&!o||o&&l&&i),[i,o,l]),[u,,p,,m]=(0,xe.useToggleState)(s===r);(0,v.useEffect)((()=>{p(c&&s===r||!c&&t)}),[s,r,c,t]);const h=(0,v.useMemo)((()=>o?n:a),[o,n,a]),g=(0,v.useMemo)((()=>o&&!l),[o,l]);return u&&(0,b.createElement)(xe.Notifications.Notification,{id:"ai-sparks-limit",className:e,variant:"info",dismissScreenReaderLabel:(0,d.__)("Close","wordpress-seo"),title:c?(0,d.sprintf)(/* translators: %s is the number of the sparks. */ (0,d._n)("You've used %s spark this month.","You've used %s sparks this month.",r,"wordpress-seo"),r):(0,d.__)("You're out of free sparks!","wordpress-seo"),size:c?"default":"large"},c?(0,b.createElement)(Oo,{onClose:m}):(0,b.createElement)(Fo,{onClose:m,upsellLink:h,isWooUpsell:g}))};window.yoast=window.yoast||{},window.yoast.editorModules={analysis:{getL10nObject:c,getContentLocale:function(){const e=c();return(0,l.get)(e,"contentLocale","en_US")},getIndicatorForScore:function(e){return(0,l.isNil)(e)||(e/=10),function(e){switch(e){case"feedback":return{className:"na",screenReaderText:(0,d.__)("Not available","wordpress-seo"),screenReaderReadabilityText:(0,d.__)("Not available","wordpress-seo"),screenReaderInclusiveLanguageText:(0,d.__)("Not available","wordpress-seo")};case"bad":return{className:"bad",screenReaderText:(0,d.__)("Needs improvement","wordpress-seo"),screenReaderReadabilityText:(0,d.__)("Needs improvement","wordpress-seo"),screenReaderInclusiveLanguageText:(0,d.__)("Needs improvement","wordpress-seo")};case"ok":return{className:"ok",screenReaderText:(0,d.__)("OK SEO score","wordpress-seo"),screenReaderReadabilityText:(0,d.__)("OK","wordpress-seo"),screenReaderInclusiveLanguageText:(0,d.__)("Potentially non-inclusive","wordpress-seo")};case"good":return{className:"good",screenReaderText:(0,d.__)("Good SEO score","wordpress-seo"),screenReaderReadabilityText:(0,d.__)("Good","wordpress-seo"),screenReaderInclusiveLanguageText:(0,d.__)("Good","wordpress-seo")};default:return{className:"loading",screenReaderText:"",screenReaderReadabilityText:"",screenReaderInclusiveLanguageText:""}}}(u.interpreters.scoreToRating(e))},constants:e,refreshAnalysis:t},aiGenerator:{components:{Introduction:mn,SuggestionError:ko,SparksLimitNotification:qo,FeatureError:pn},helpers:{removesLocaleVariantSuffixes:Oa,fetchSuggestions:Fa}},components:{HelpLink:V,TopLevelProviders:me,higherorder:{withYoastSidebarPriority:e=>{const t=t=>{const{renderPriority:s,...r}=t;return(0,b.createElement)(e,{...r})};return t.propTypes={renderPriority:S().number},t}},contentAnalysis:{KeywordInput:H,mapResults:r},contexts:{location:{LocationContext:o.LocationContext,LocationProvider:o.LocationProvider,LocationConsumer:o.LocationConsumer}},SidebarItem:ue,SidebarCollapsible:ce,MetaboxCollapsible:e=>(0,b.createElement)(G,{hasPadding:!0,hasSeparator:!0,...e}),Modal:J,portals:{Portal:ae,ImageSelectPortal:ne,ScoreIconPortal:ie},FieldsetLayout:mr,UnsavedChangesModal:aa,YoastLogo:e=>b.createElement("svg",ha({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"yoast-logo_svg__w-40",viewBox:"0 0 842 224"},e),pa||(pa=b.createElement("path",{fill:"#a61e69",d:"M166.55 54.09c-38.69 0-54.17 25.97-54.17 54.88s15.25 56.02 54.17 56.02 54.07-27.19 54-54.26c-.09-32.97-16.77-56.65-54-56.65Zm-23.44 56.52c.94-38.69 30.66-38.65 40.59-24.79 9.05 12.63 10.9 55.81-17.14 55.5-12.92-.14-23.06-8.87-23.44-30.71Zm337.25 27.55V82.11h20.04V57.78h-20.04V28.39h-30.95v29.39h-15.7v24.33h15.7v52.87c0 30.05 20.95 47.91 43.06 51.61l9.24-24.88c-12.89-1.63-21.23-11.27-21.35-23.54Zm-156.15-8.87V87.16c0-1.54-.1-2.98-.25-4.39-2.68-34.04-51.02-33.97-88.46-20.9l10.82 21.78c24.38-11.58 38.97-8.59 44.07-2.89.13.15.26.29.38.45.01.02.03.04.04.06 2.6 3.51 1.98 9.05 1.98 13.41-31.86 0-65.77 4.23-65.77 39.17 0 26.56 33.28 43.65 68.06 18.33l5.16 12.45h29.81c-2.66-14.62-5.85-27.14-5.85-35.34Zm-31.18-.23c-24.51 27.43-46.96 1.61-23.97-9.65 6.77-2.31 15.95-2.41 23.97-2.41v12.06Zm78.75-44.17c0-10.38 16.61-15.23 42.82-3.27l9.06-22.01c-35.27-10.66-83.44-11.62-83.75 25.28-.15 17.68 11.19 27.19 27.52 33.26 11.31 4.2 27.64 6.38 27.59 15.39-.06 11.77-25.38 13.57-48.42-2.26l-9.31 23.87c31.43 15.64 89.87 16.08 89.56-23.12-.31-38.76-55.08-32.11-55.08-47.14ZM99.3 1 54.44 125.61 32.95 58.32H1l35.78 91.89a33.49 33.49 0 0 1 0 24.33c-4 10.25-10.65 19.03-26.87 21.21v27.24c31.58 0 48.65-19.41 63.88-61.96L133.48 1H99.3ZM598.64 139.05c0 8.17-2.96 14.58-8.87 19.23-5.91 4.65-14.07 6.98-24.47 6.98s-18.92-1.61-25.54-4.84v-14.2c4.19 1.97 8.65 3.52 13.37 4.65 4.72 1.13 9.11 1.7 13.18 1.7 5.95 0 10.35-1.13 13.18-3.39 2.83-2.26 4.25-5.3 4.25-9.11 0-3.43-1.3-6.35-3.9-8.74-2.6-2.39-7.97-5.22-16.1-8.48-8.39-3.39-14.3-7.27-17.74-11.63-3.44-4.36-5.16-9.59-5.16-15.71 0-7.67 2.72-13.7 8.18-18.1 5.45-4.4 12.77-6.6 21.95-6.6s17.57 1.93 26.29 5.78l-4.78 12.26c-8.18-3.43-15.47-5.15-21.89-5.15-4.87 0-8.55 1.06-11.07 3.17-2.52 2.12-3.77 4.91-3.77 8.39 0 2.39.5 4.43 1.51 6.13s2.66 3.3 4.97 4.81c2.3 1.51 6.46 3.5 12.45 5.97 6.75 2.81 11.7 5.43 14.85 7.86 3.15 2.43 5.45 5.18 6.92 8.23 1.46 3.06 2.2 6.66 2.2 10.81Zm68.53 24.96h-52.02V72.12h52.02v12.7h-36.99v25.01h34.66v12.57h-34.66v28.85h36.99v12.76Zm100.24-46.07c0 14.96-3.74 26.59-11.23 34.88-7.49 8.3-18.08 12.44-31.8 12.44s-24.54-4.12-31.99-12.35c-7.44-8.23-11.17-19.93-11.17-35.1s3.74-26.82 11.23-34.95c7.49-8.13 18.17-12.19 32.05-12.19s24.24 4.13 31.7 12.38c7.47 8.26 11.2 19.88 11.2 34.88Zm-70.2 0c0 11.31 2.29 19.89 6.86 25.74 4.57 5.85 11.35 8.77 20.32 8.77s15.67-2.89 20.22-8.67c4.55-5.78 6.82-14.39 6.82-25.83s-2.25-19.82-6.76-25.64-11.23-8.74-20.16-8.74-15.82 2.91-20.41 8.74c-4.59 5.82-6.89 14.37-6.89 25.64Z"})),ma||(ma=b.createElement("path",{fill:"#77b227",d:"m790.45 165.35 36.05-94.96H840l-36.02 94.96h-13.53z"}))),SidebarLayout:({contentClassName:e="",children:t})=>(0,b.createElement)("div",{className:"yst-flex yst-gap-6 xl:yst-flex-row yst-flex-col relative"},(0,b.createElement)("div",{className:Vr()("yst-@container yst-flex yst-flex-grow yst-flex-col",e)},t)),ErrorFallback:ur},containers:{EditorModal:Ee,PersistentDismissableAlert:ve,Results:Ve,SEMrushRelatedKeyphrases:Xe,WincherSEOPerformance:Fs},helpers:{ajaxHelper:a,createInterpolateElement:Ne,createWatcher:(e,t)=>{let s=e();return()=>{const r=e();(0,l.isEqual)(r,s)||(s=r,t((0,l.clone)(r)))}},isBlockEditor:function(){return window.wpseoScriptData&&"1"===window.wpseoScriptData.isBlockEditor},i18n:{setTextdomainL10n:function(e,t="wpseoYoastJSL10n"){const s=(0,l.get)(window,[t,e,"locale_data",e],!1);"yoast-components"===e&&(e="wordpress-seo"),!1===s?(0,d.setLocaleData)({"":{}},e):(0,d.setLocaleData)(s,e)}},replacementVariableHelpers:n,publishBox:{updateScore:function(e,t,s=null){var r=ar("#"+e+"-score"),a=rr+" "+t;r.children(".image").attr("class",a);var n=nr(e,t,s);r.children("."+sr).html(n)},createScoresInPublishBox:function(e,t,s=null){const r=ar("<div />",{class:"misc-pub-section yoast yoast-seo-score "+e+"-score",id:e+"-score"}),a=ar("<span />",{class:sr,html:nr(e,t,s)}),n=ar("<span>").attr("class",rr+" na");r.append(n).append(a),ar("#yoast-seo-publishbox-section").append(r)},scrollToCollapsible:function(e){const t=ar("#wpadminbar"),s=ar(e);if(!t||!s)return;const r="fixed"===t.css("position")?t.height():0;ar([document.documentElement,document.body]).animate({scrollTop:s.offset().top-r},1e3),s.trigger("focus"),0===s.parent().siblings().length&&s.trigger("click")}},updateAdminBar:function(e){jQuery("#wp-admin-bar-wpseo-menu .wpseo-score-icon").attr("title",e.screenReaderText).attr("class","wpseo-score-icon "+e.className).find(".wpseo-score-text").text(e.screenReaderText)},updateTrafficLight:function(e){var t=jQuery(".yst-traffic-light"),s=t.closest(".wpseo-meta-section-link"),r=jQuery("#wpseo-traffic-light-desc"),a=e.className||"na";t.attr("class","yst-traffic-light "+a),s.attr("aria-describedby","wpseo-traffic-light-desc"),r.length>0?r.text(e.screenReaderText):s.closest("li").append("<span id='wpseo-traffic-light-desc' class='screen-reader-text'>"+e.screenReaderText+"</span>")}}}})()})();