AlkantarClanX12

Your IP : 216.73.217.24


Current Path : /www/capitalgmcbuickregina_830/public/wp-content/plugins/wordpress-seo/js/dist/
Upload File :
Current File : /www/capitalgmcbuickregina_830/public/wp-content/plugins/wordpress-seo/js/dist/ai-generator.js

(()=>{var e={818(e,t,s){const r=s(1609),i=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{fillRule:"evenodd",d:"M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))});e.exports=i},1609(e){"use strict";e.exports=window.React},2485(e,t){var s;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var s=arguments[t];if(s){var o=typeof s;if("string"===o||"number"===o)e.push(s);else if(Array.isArray(s)){if(s.length){var n=i.apply(null,s);n&&e.push(n)}}else if("object"===o){if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]")){e.push(s.toString());continue}for(var a in s)r.call(s,a)&&s[a]&&e.push(a)}}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(s=function(){return i}.apply(t,[]))||(e.exports=s)}()},2514(e,t,s){const r=s(1609),i=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z"}))});e.exports=i},2863(e,t,s){const r=s(1609),i=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"}))});e.exports=i},3473(e,t,s){const r=s(1609),i=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"}))});e.exports=i},5074(e,t,s){const r=s(1609),i=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}))});e.exports=i},5687(e,t,s){const r=s(1609),i=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{fillRule:"evenodd",d:"M10.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L12.586 11H5a1 1 0 110-2h7.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))});e.exports=i},6702(e,t,s){const r=s(1609),i=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"}))});e.exports=i},7219(e,t,s){const r=s(1609),i=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"}))});e.exports=i},8738(e,t,s){const r=s(1609),i=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"}))});e.exports=i}},t={};function s(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,s),o.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.components,t=window.wp.data,r=window.wp.hooks,i=window.yoast.uiLibrary,o=window.lodash,n=window.yoast.reduxJsToolkit,a="adminUrl",l=(0,n.createSlice)({name:a,initialState:"",reducers:{setAdminUrl:(e,{payload:t})=>t}}),c=(l.getInitialState,{selectAdminUrl:e=>(0,o.get)(e,a,"")});c.selectAdminLink=(0,n.createSelector)([c.selectAdminUrl,(e,t)=>t],(e,t="")=>{try{return new URL(t,e).href}catch(t){return e}}),l.actions,l.reducer;const d=window.wp.apiFetch;var p=s.n(d);const u="hasConsent",h=`${u}/storeConsent`,m=(0,n.createSlice)({name:u,initialState:{hasConsent:!1,endpoint:""},reducers:{giveAiGeneratorConsent:(e,{payload:t})=>{e.hasConsent=t},setAiGeneratorConsentEndpoint:(e,{payload:t})=>{e.endpoint=t}}}),g=m.getInitialState,y={selectHasAiGeneratorConsent:e=>(0,o.get)(e,[u,"hasConsent"],m.getInitialState().hasConsent),selectAiGeneratorConsentEndpoint:e=>(0,o.get)(e,[u,"endpoint"],m.getInitialState().endpoint)},x={...m.actions,storeAiGeneratorConsent:function*(e,t){try{yield{type:h,payload:{consent:e,endpoint:t}}}catch(e){return!1}return yield{type:`${u}/giveAiGeneratorConsent`,payload:e},!0}},w={[h]:async({payload:e})=>await p()({path:e.endpoint,method:"POST",data:{consent:e.consent},parse:!1})},f=m.reducer,v=window.wp.url,b="linkParams",S=(0,n.createSlice)({name:b,initialState:{},reducers:{setLinkParams:(e,{payload:t})=>t}}),j=(S.getInitialState,{selectLinkParam:(e,t,s={})=>(0,o.get)(e,`${b}.${t}`,s),selectLinkParams:e=>(0,o.get)(e,b,{})});j.selectLink=(0,n.createSelector)([j.selectLinkParams,(e,t)=>t,(e,t,s={})=>s],(e,t,s)=>(0,v.addQueryArgs)(t,{...e,...s})),S.actions,S.reducer;const C=(0,n.createSlice)({name:"notifications",initialState:{},reducers:{addNotification:{reducer:(e,{payload:t})=>{e[t.id]={id:t.id,variant:t.variant,size:t.size,title:t.title,description:t.description}},prepare:({id:e,variant:t="info",size:s="default",title:r,description:i})=>({payload:{id:e||(0,n.nanoid)(),variant:t,size:s,title:r||"",description:i}})},removeNotification:(e,{payload:t})=>(0,o.omit)(e,t)}}),k=(C.getInitialState,C.actions,C.reducer,"pluginUrl"),_=(0,n.createSlice)({name:k,initialState:"",reducers:{setPluginUrl:(e,{payload:t})=>t}}),E=(_.getInitialState,{selectPluginUrl:e=>(0,o.get)(e,k,"")});E.selectImageLink=(0,n.createSelector)([E.selectPluginUrl,(e,t,s="images")=>s,(e,t)=>t],(e,t,s)=>[(0,o.trimEnd)(e,"/"),(0,o.trim)(t,"/"),(0,o.trimStart)(s,"/")].join("/")),_.actions,_.reducer;const R="request",I="success",L="error",T="idle",A="loading",M="success",P="error",N="showPlay",O="askPermission",$="isPlaying",F="wistiaEmbedPermission",q=(0,n.createSlice)({name:F,initialState:{value:!1,status:T,error:{}},reducers:{setWistiaEmbedPermissionValue:(e,{payload:t})=>{e.value=Boolean(t)}},extraReducers:e=>{e.addCase(`${F}/${R}`,e=>{e.status=A}),e.addCase(`${F}/${I}`,(e,{payload:t})=>{e.status=M,e.value=Boolean(t&&t.value)}),e.addCase(`${F}/${L}`,(e,{payload:t})=>{e.status=P,e.value=Boolean(t&&t.value),e.error={code:(0,o.get)(t,"error.code",500),message:(0,o.get)(t,"error.message","Unknown")}})}});var U;q.getInitialState,q.actions,q.reducer;const W=(0,n.createSlice)({name:"documentTitle",initialState:(0,o.defaultTo)(null===(U=document)||void 0===U?void 0:U.title,""),reducers:{setDocumentTitle:(e,{payload:t})=>t}}),B=(W.getInitialState,W.actions,W.reducer,window.yoast.propTypes);var G=s.n(B);const D="yoast-seo/ai-generator",H="yoast-seo/editor",z="google",Y="social",V="twitter",K="title",Z="description",X="post",J="term",Q={post:"title",term:"term_title"},ee=(0,o.mapValues)(Q,e=>`%%${e}%%`),te={idle:"idle",loading:"loading",success:"success",error:"error"},se="success",re="error",ie="abort",oe=window.wp.i18n,ne=window.wp.element,ae=(e,t)=>{try{return(0,ne.createInterpolateElement)(e,t)}catch(t){return console.error("Error in translation for:",e,t),e}};var le=s(6702),ce=s.n(le);const de=window.ReactJSXRuntime;G().string.isRequired;var pe=s(2514),ue=s.n(pe),he=s(818),me=s.n(he);G().string.isRequired,G().string.isRequired,G().shape({src:G().string.isRequired,width:G().string,height:G().string}).isRequired,G().shape({value:G().bool.isRequired,status:G().string.isRequired,set:G().func.isRequired}).isRequired,G().string,G().string,G().string;const ge=({handleRefreshClick:e,supportLink:t})=>(0,de.jsxs)("div",{className:"yst-flex yst-gap-2",children:[(0,de.jsx)(i.Button,{onClick:e,children:(0,oe.__)("Refresh this page","wordpress-seo")}),(0,de.jsx)(i.Button,{variant:"secondary",as:"a",href:t,target:"_blank",rel:"noopener",children:(0,oe.__)("Contact support","wordpress-seo")})]});ge.propTypes={handleRefreshClick:G().func.isRequired,supportLink:G().string.isRequired};const ye=({handleRefreshClick:e,supportLink:t})=>(0,de.jsxs)("div",{className:"yst-grid yst-grid-cols-1 yst-gap-y-2",children:[(0,de.jsx)(i.Button,{className:"yst-order-last",onClick:e,children:(0,oe.__)("Refresh this page","wordpress-seo")}),(0,de.jsx)(i.Button,{variant:"secondary",as:"a",href:t,target:"_blank",rel:"noopener",children:(0,oe.__)("Contact support","wordpress-seo")})]});ye.propTypes={handleRefreshClick:G().func.isRequired,supportLink:G().string.isRequired};const xe=({error:e,children:t=null})=>(0,de.jsxs)("div",{role:"alert",className:"yst-max-w-screen-sm yst-p-8 yst-space-y-4",children:[(0,de.jsx)(i.Title,{children:(0,oe.__)("Something went wrong. An unexpected error occurred.","wordpress-seo")}),(0,de.jsx)("p",{children:(0,oe.__)("We're very sorry, but it seems like the following error has interrupted our application:","wordpress-seo")}),(0,de.jsx)(i.Alert,{variant:"error",children:(null==e?void 0:e.message)||(0,oe.__)("Undefined error message.","wordpress-seo")}),(0,de.jsx)("p",{children:(0,oe.__)("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]});xe.propTypes={error:G().object.isRequired,children:G().node},xe.VerticalButtons=ye,xe.HorizontalButtons=ge;G().string,G().node.isRequired,G().node.isRequired,G().node,G().oneOf(Object.keys({lg:{grid:"yst-grid lg:yst-grid-cols-3 lg:yst-gap-12",col1:"yst-col-span-1",col2:"lg:yst-mt-0 lg:yst-col-span-2"},xl:{grid:"yst-grid xl:yst-grid-cols-3 xl:yst-gap-12",col1:"yst-col-span-1",col2:"xl:yst-mt-0 xl:yst-col-span-2"},"2xl":{grid:"yst-grid 2xl:yst-grid-cols-3 2xl:yst-gap-12",col1:"yst-col-span-1",col2:"2xl:yst-mt-0 2xl:yst-col-span-2"}}));var we=s(1609),fe=s.n(we);const ve=window.ReactDOM;var be,Se,je;(Se=be||(be={})).Pop="POP",Se.Push="PUSH",Se.Replace="REPLACE",function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(je||(je={})),new Set(["lazy","caseSensitive","path","id","index","children"]),Error;const Ce=["post","put","patch","delete"],ke=(new Set(Ce),["get",...Ce]);new Set(ke),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred"),we.Component,we.startTransition,new Promise(()=>{}),we.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(e){}var _e,Ee,Re,Ie;new Map,we.startTransition,ve.flushSync,we.useId,"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,(Ie=_e||(_e={})).UseScrollRestoration="useScrollRestoration",Ie.UseSubmit="useSubmit",Ie.UseSubmitFetcher="useSubmitFetcher",Ie.UseFetcher="useFetcher",Ie.useViewTransitionState="useViewTransitionState",(Re=Ee||(Ee={})).UseFetcher="useFetcher",Re.UseFetchers="useFetchers",Re.UseScrollRestoration="useScrollRestoration",G().string.isRequired,G().string;const Le=({href:e,children:t=null,...s})=>(0,de.jsxs)(i.Link,{target:"_blank",rel:"noopener noreferrer",...s,href:e,children:[t,(0,de.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,oe.__)("(Opens in a new browser tab)","wordpress-seo")})]});Le.propTypes={href:G().string.isRequired,children:G().node};s(8738);(0,oe.__)("Create optimized SEO titles & meta descriptions in seconds","wordpress-seo"),(0,oe.__)("Apply AI suggestions to improve content in 1 click","wordpress-seo"),(0,oe.__)("Manage redirects with ease and without extra plugins","wordpress-seo"),(0,oe.__)("Optimize pages for multiple keywords with guidance","wordpress-seo"),(0,oe.__)("Add product details to help your listings stand out","wordpress-seo"),(0,oe.__)("Make sure search engines show the right version of your product page","wordpress-seo"),(0,oe.__)("Create optimized SEO titles & meta descriptions with AI","wordpress-seo"),(0,oe.__)("Receive clear SEO and readability guidance to optimize your products","wordpress-seo"),(0,oe.__)("Generate SEO optimized metadata in seconds with AI","wordpress-seo"),(0,oe.__)("Make your articles visible, be seen in Google News","wordpress-seo"),(0,oe.__)("Built to get found by search, AI, and real users","wordpress-seo"),(0,oe.__)("Easy Local SEO. Show up in Google Maps results","wordpress-seo"),(0,oe.__)("Internal links and redirect management, easy","wordpress-seo"),(0,oe.__)("Access to friendly help when you need it, day or night","wordpress-seo");var Te=s(2485),Ae=s.n(Te);G().string.isRequired,G().object.isRequired,G().func.isRequired,G().bool.isRequired,s(3473),G().string.isRequired,G().object,G().func.isRequired,G().bool.isRequired,G().string.isRequired,G().object.isRequired,G().string.isRequired,G().func.isRequired,G().bool.isRequired;var Me=s(5074),Pe=s.n(Me);G().bool.isRequired,G().func,G().func,G().string.isRequired,G().string.isRequired,G().string.isRequired,G().string.isRequired;const Ne=window.yoast.reactHelmet,Oe=({videoId:e,thumbnail:t,wistiaEmbedPermission:s,className:r=""})=>{const[o,n]=(0,ne.useState)(s.value?$:N),a=(0,ne.useCallback)(()=>n($),[n]),l=(0,ne.useCallback)(()=>{s.value?a():n(O)},[s.value,a,n]),c=(0,ne.useCallback)(()=>n(N),[n]),d=(0,ne.useCallback)(()=>{s.set(!0),a()},[s.set,a]);return(0,de.jsxs)(de.Fragment,{children:[s.value&&(0,de.jsx)(Ne.Helmet,{children:(0,de.jsx)("script",{src:"https://fast.wistia.com/assets/external/E-v1.js",async:!0})}),(0,de.jsxs)("div",{className:Ae()("yst-relative yst-w-full yst-h-0 yst-pt-[47.25%] yst-overflow-hidden yst-rounded-md yst-drop-shadow-md yst-bg-white",r),children:[o===N&&(0,de.jsx)("button",{type:"button",className:"yst-absolute yst-inset-0 yst-button yst-p-0 yst-border-none yst-bg-white yst-transition-opacity yst-duration-1000 yst-opacity-100",onClick:l,children:(0,de.jsx)("img",{className:"yst-w-full yst-h-auto yst-object-contain",alt:"",loading:"lazy",decoding:"async",...t})}),o===O&&(0,de.jsxs)("div",{className:"yst-absolute yst-inset-0 yst-flex yst-flex-col yst-items-center yst-justify-center yst-bg-white",children:[(0,de.jsxs)("p",{className:"yst-max-w-xs yst-mx-auto yst-text-center",children:[s.status===A&&(0,de.jsx)(i.Spinner,{}),s.status!==A&&(0,oe.sprintf)(/* translators: %1$s expands to Yoast SEO. %2$s expands to Wistia. */ /* translators: %1$s expands to Yoast SEO. %2$s expands to Wistia. */
(0,oe.__)("To see this video, you need to allow %1$s to load embedded videos from %2$s.","wordpress-seo"),"Yoast SEO","Wistia")]}),(0,de.jsxs)("div",{className:"yst-flex yst-mt-6 yst-gap-x-4",children:[(0,de.jsx)(i.Button,{type:"button",variant:"secondary",onClick:c,disabled:s.status===A,children:(0,oe.__)("Deny","wordpress-seo")}),(0,de.jsx)(i.Button,{type:"button",variant:"primary",onClick:d,disabled:s.status===A,children:(0,oe.__)("Allow","wordpress-seo")})]})]}),s.value&&o===$&&(0,de.jsxs)("div",{className:"yst-absolute yst-w-full yst-h-full yst-top-0 yst-right-0",children:[null===e&&(0,de.jsx)(i.Spinner,{className:"yst-h-full yst-mx-auto"}),null!==e&&(0,de.jsx)("div",{className:`wistia_embed wistia_async_${e} videoFoam=true`})]})]})]})};Oe.propTypes={videoId:G().string.isRequired,thumbnail:G().shape({src:G().string.isRequired,width:G().string,height:G().string}).isRequired,wistiaEmbedPermission:G().shape({value:G().bool.isRequired,status:G().string.isRequired,set:G().func.isRequired}).isRequired,hasPadding:G().bool},s(5687),G().bool.isRequired,G().func.isRequired,G().func,G().string;const $e=({onGiveConsent:e,learnMoreLink:t,privacyPolicyLink:s,termsOfServiceLink:r,imageLink:o,linkStoreName:n})=>{const{onClose:a,initialFocus:l}=(0,i.useModalContext)(),[c,d]=(0,i.useToggleState)(!1),[p,u]=(0,ne.useState)(!1),h=(0,ne.useMemo)(()=>({src:o,width:"432",height:"244"}),[o]),m=ae((0,oe.sprintf)(/* translators: %1$s and %2$s are a set of anchor tags and %3$s and %4$s are a set of anchor tags. */ /* translators: %1$s and %2$s are a set of anchor tags and %3$s and %4$s are a set of anchor tags. */
(0,oe.__)("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,de.jsx)(Le,{href:r}),a2:(0,de.jsx)(Le,{href:s})}),[g,y]=(0,i.useToggleState)(!1),x=(0,ne.useCallback)(async()=>{y();const t=await e();u(!1===t),y()},[e]);return(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center",children:(0,de.jsx)("div",{className:"yst-relative yst-w-full",children:(0,de.jsx)("img",{className:"yst-w-full yst-h-auto yst-rounded-md yst-drop-shadow-md",alt:"",loading:"lazy",decoding:"async",...h})})}),(0,de.jsxs)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center",children:[(0,de.jsxs)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center",children:[(0,de.jsx)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium",children:(0,oe.sprintf)(/* translators: %s expands to Yoast AI. */ /* translators: %s expands to Yoast AI. */
(0,oe.__)("Grant consent for %s","wordpress-seo"),"Yoast AI")}),(0,de.jsx)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm",children:ae((0,oe.sprintf)(/* translators: %1$s is a break tag; %2$s and %3$s are anchor tag; %4$s is the arrow icon. */ /* translators: %1$s is a break tag; %2$s and %3$s are anchor tag; %4$s is the arrow icon. */
(0,oe.__)("Enable AI-powered SEO! Use all Yoast AI features to boost your efficiency. Just give us the green light. %1$s%2$sLearn more%3$s%4$s","wordpress-seo"),"<br/>","<a>","<ArrowNarrowRightIcon />","</a>"),{a:(0,de.jsx)(Le,{href:t,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,de.jsx)(me(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"}),br:(0,de.jsx)("br",{})})})]}),(0,de.jsx)("div",{className:"yst-flex yst-w-full yst-mt-6",children:(0,de.jsx)("hr",{className:"yst-w-full yst-text-gray-200"})}),(0,de.jsxs)("div",{className:"yst-flex yst-items-start yst-mt-4",children:[(0,de.jsx)("input",{type:"checkbox",id:"yst-ai-consent-checkbox",name:"yst-ai-consent-checkbox",checked:c,value:c?"true":"false",onChange:d,className:"yst-checkbox__input",ref:l}),(0,de.jsx)("label",{htmlFor:"yst-ai-consent-checkbox",className:"yst-label yst-checkbox__label yst-text-xs yst-font-normal yst-text-slate-500",children:m})]}),p&&(0,de.jsx)(De,{className:"yst-mt-3",linkStoreName:n}),(0,de.jsx)("div",{className:"yst-w-full yst-flex yst-mt-4",children:(0,de.jsxs)(i.Button,{as:"button",className:"yst-grow",size:"large",disabled:!c||p,onClick:x,children:[g&&!p&&(0,de.jsx)(i.Spinner,{className:"yst-me-2"}),(0,oe.__)("Grant consent","wordpress-seo")]})}),(0,de.jsx)(i.Button,{as:"button",className:"yst-mt-4",variant:"tertiary",onClick:a,children:(0,oe.__)("Close","wordpress-seo")})]})]})};$e.propTypes={onGiveConsent:G().func.isRequired,learnMoreLink:G().string.isRequired,privacyPolicyLink:G().string.isRequired,termsOfServiceLink:G().string.isRequired,imageLink:G().string.isRequired,linkStoreName:G().string.isRequired};const Fe={termsOfService:"https://yoa.st/ai-generator-terms-of-service",privacyPolicy:"https://yoa.st/ai-generator-privacy-policy",learnMore:"https://yoa.st/ai-generator-learn-more"},qe=({storeName:e,onConsentGranted:s,linkStoreName:r,links:i={}})=>{const o=(0,ne.useMemo)(()=>({...Fe,...i}),[i]),{termsOfServiceLink:n,privacyPolicyLink:a,learnMoreLink:l,imageLink:c,endpoint:d}=(0,t.useSelect)(t=>{const s=t(r),i=t(e);return{termsOfServiceLink:s.selectLink(o.termsOfService),privacyPolicyLink:s.selectLink(o.privacyPolicy),learnMoreLink:s.selectLink(o.learnMore),imageLink:s.selectImageLink("ai-consent.jpg"),endpoint:i.selectAiGeneratorConsentEndpoint()}},[r,e,o]),{storeAiGeneratorConsent:p}=(0,t.useDispatch)(e),u=(0,ne.useCallback)(async()=>{const e=await p(!0,d);return!1!==e&&s(),e},[p,s,d]);return(0,de.jsx)($e,{termsOfServiceLink:n,privacyPolicyLink:a,learnMoreLink:l,imageLink:c,onGiveConsent:u,linkStoreName:r})};qe.propTypes={storeName:G().string.isRequired,onConsentGranted:G().func.isRequired,linkStoreName:G().string.isRequired,links:G().shape({termsOfService:G().string,privacyPolicy:G().string,learnMore:G().string})};const Ue=({children:e})=>(0,de.jsx)("p",{className:"yst-mt-2",children:e});Ue.propTypes={children:G().node.isRequired};const We=()=>(0,t.useSelect)(e=>{const t=e(H);return{commonErrorsLink:t.selectLink("https://yoa.st/ai-common-errors"),supportLink:t.selectAdminLink("?page=wpseo_page_support")}},[]),Be=(0,oe.__)("Something went wrong","wordpress-seo"),Ge=({linkStoreName:e=H})=>{const s=(0,t.useSelect)(t=>t(e).selectLink("https://yoa.st/ai-common-errors"),[e]),r=(0,t.useSelect)(t=>t(e).selectAdminLink("?page=wpseo_page_support"),[e]);return(0,de.jsx)(Ue,{children:ae((0,oe.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ /* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */
(0,oe.__)("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,de.jsx)(Le,{variant:"error",href:s}),a2:(0,de.jsx)(Le,{variant:"error",href:r})})})};Ge.propTypes={linkStoreName:G().string};const De=({linkStoreName:e=H,className:t=""})=>(0,de.jsxs)(i.Alert,{variant:"error",className:t,children:[(0,de.jsx)("span",{className:"yst-block yst-font-medium",children:Be}),(0,de.jsx)(Ge,{linkStoreName:e})]});De.propTypes={linkStoreName:G().string,className:G().string};const He=(0,oe.__)("Not enough content","wordpress-seo"),ze=()=>{const{commonErrorsLink:e,supportLink:t}=We();return(0,de.jsx)(Ue,{children:ae((0,oe.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ /* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */
(0,oe.__)("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,de.jsx)(Le,{variant:"error",href:e}),a2:(0,de.jsx)(Le,{variant:"error",href:t})})})},Ye=()=>(0,de.jsxs)(i.Alert,{variant:"error",children:[(0,de.jsx)("span",{className:"yst-block yst-font-medium",children:He}),(0,de.jsx)(ze,{})]}),Ve=(0,oe.__)("SEO analysis required","wordpress-seo"),Ke=()=>{const e=(0,t.useSelect)(e=>e(H).selectAdminLink("?page=wpseo_page_settings#/site-features#card-wpseo-keyword_analysis_active"),[]);return(0,de.jsx)(Ue,{children:ae((0,oe.sprintf)(
/**
     * translators:
     * %1$s expands to Yoast SEO.
     * %2$s and %3$s expand to an opening and closing anchor tag, respectively, that links to the settings page.
     * %4$s expands to Yoast AI.
     */
/**
     * translators:
     * %1$s expands to Yoast SEO.
     * %2$s and %3$s expand to an opening and closing anchor tag, respectively, that links to the settings page.
     * %4$s expands to Yoast AI.
     */
(0,oe.__)("%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,de.jsx)(Le,{variant:"error",href:e})})})},Ze=(0,oe.__)("You've reached the Yoast AI rate limit","wordpress-seo"),Xe=()=>{const e=(0,t.useSelect)(e=>e(H).selectLink("https://yoa.st/ai-generator-rate-limit-help"),[]);return(0,de.jsx)(Ue,{children:ae((0,oe.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */
(0,oe.__)("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,de.jsx)(Le,{variant:"error",href:e})})})},Je=()=>(0,de.jsxs)(i.Alert,{variant:"error",children:[(0,de.jsx)("span",{className:"yst-block yst-font-medium",children:Ze}),(0,de.jsx)(Xe,{})]}),Qe=(0,oe.__)("Subscription required","wordpress-seo"),et=({invalidSubscriptions:e=[]})=>{const{newYoastWooLink:s,activateYoastWooLink:r,newPremiumLink:i,activatePremiumLink:o}=(0,t.useSelect)(e=>{const t=e(H);return{newYoastWooLink:t.selectLink("https://yoa.st/ai-generator-new-yoast-woocommerce"),activateYoastWooLink:t.selectLink("https://yoa.st/ai-generator-activate-yoast-woocommerce"),newPremiumLink:t.selectLink("https://yoa.st/ai-generator-new-premium"),activatePremiumLink:t.selectLink("https://yoa.st/ai-generator-activate-premium")}},[]);let n,a,l;return e.includes("Yoast WooCommerce SEO")?(n="Yoast WooCommerce SEO",a=r,l=s):e.includes("Yoast SEO Premium")&&(n="Yoast SEO Premium",a=o,l=i),n?(0,de.jsx)(Ue,{children:ae((0,oe.sprintf)(
/**
     * translators:
     * %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO.
     * %2$s expands to MyYoast.
     * %3$s and %4$s expand to an opening and closing anchor tag, respectively, to activate your subscription.
     * %5$s and %6$s expand to an opening and closing anchor tag, respectively, to get a new subscription.
     **/
/**
     * translators:
     * %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO.
     * %2$s expands to MyYoast.
     * %3$s and %4$s expand to an opening and closing anchor tag, respectively, to activate your subscription.
     * %5$s and %6$s expand to an opening and closing anchor tag, respectively, to get a new subscription.
     **/
(0,oe.__)("To access this feature, you need an active %1$s subscription. Please %3$sactivate your subscription in %2$s%4$s or %5$sget a new %1$s subscription%6$s. Afterward, refresh this page. It may take up to 30 seconds for the feature to function correctly.","wordpress-seo"),n,"MyYoast","<Activate>","</Activate>","<New>","</New>"),{Activate:(0,de.jsx)(Le,{variant:"error",href:a}),New:(0,de.jsx)(Le,{variant:"error",href:l})})}):(0,de.jsx)(Ue,{children:ae((0,oe.sprintf)(
/**
       * translators:
       * %1$s expands to MyYoast.
       * %2$s and %3$s expand to an opening and closing anchor tag, respectively, to activate your subscription.
       **/
/**
       * translators:
       * %1$s expands to MyYoast.
       * %2$s and %3$s expand to an opening and closing anchor tag, respectively, to activate your subscription.
       **/
(0,oe.__)("To access this feature, you need an active subscription. Please %2$sactivate your subscription in %1$s%3$s. Afterward, refresh this page. It may take up to 30 seconds for the feature to function correctly.","wordpress-seo"),"MyYoast","<Activate>","</Activate>"),{Activate:(0,de.jsx)(Le,{variant:"error",href:o})})})};et.propTypes={invalidSubscriptions:G().arrayOf(G().string)};const tt=({invalidSubscriptions:e=[]})=>{const s=(0,t.useSelect)(e=>e(D).selectBustSubscriptionCacheEndpoint(),[]),{onClose:r}=(0,i.useModalContext)(),o=(0,ne.useCallback)(async()=>{try{await p()({path:s,method:"POST",parse:!1})}catch(e){console.error(e)}window.location.reload()},[]);return(0,de.jsxs)(ne.Fragment,{children:[(0,de.jsxs)(i.Alert,{variant:"error",children:[(0,de.jsx)("span",{className:"yst-block yst-font-medium",children:Qe}),(0,de.jsx)(et,{invalidSubscriptions:e})]}),(0,de.jsxs)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end",children:[(0,de.jsx)(i.Button,{variant:"secondary",onClick:r,children:(0,oe.__)("Close","wordpress-seo")}),(0,de.jsx)(i.Button,{variant:"primary",onClick:o,children:(0,oe.__)("Refresh page","wordpress-seo")})]})]})};tt.propTypes={invalidSubscriptions:G().arrayOf(G().string)};const st=(0,oe.__)("Connection timeout","wordpress-seo"),rt=()=>{const{commonErrorsLink:e,supportLink:t}=We();return(0,de.jsx)(Ue,{children:ae((0,oe.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ /* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */
(0,oe.__)("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,de.jsx)(Le,{variant:"error",href:e}),a2:(0,de.jsx)(Le,{variant:"error",href:t})})})},it=()=>(0,de.jsxs)(i.Alert,{variant:"error",children:[(0,de.jsx)("span",{className:"yst-block yst-font-medium",children:st}),(0,de.jsx)(rt,{})]}),ot=(0,oe.__)("Usage policy violation","wordpress-seo"),nt=()=>{const e=(0,t.useSelect)(e=>e(H).selectAdminLink("?page=wpseo_page_support"),[]);return(0,de.jsx)(Ue,{children:ae((0,oe.sprintf)(/* translators: %1$s, %2$s, %3$s, %4$s are anchor tags. %5$s expands to OpenAI. */ /* translators: %1$s, %2$s, %3$s, %4$s are anchor tags. %5$s expands to OpenAI. */
(0,oe.__)("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,de.jsx)(Le,{variant:"error",href:"https://openai.com/policies/usage-policies"}),a2:(0,de.jsx)(Le,{variant:"error",href:e})})})},at=()=>(0,de.jsxs)(i.Alert,{variant:"error",children:[(0,de.jsx)("span",{className:"yst-block yst-font-medium",children:ot}),(0,de.jsx)(nt,{})]}),lt=(0,oe.__)("Something went wrong","wordpress-seo"),ct=({errorMessage:e=""})=>{const s=(0,t.useSelect)(e=>e(H).selectAdminLink("?page=wpseo_page_support"),[]);return(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(Ue,{children:(0,oe.sprintf)(/* translators: %s is the error response of the request. */ /* translators: %s is the error response of the request. */
(0,oe.__)("The request came back with the following error: '%s'.","wordpress-seo"),e)}),(0,de.jsx)(Ue,{children:ae((0,oe.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */
(0,oe.__)("Please try again later. If the issue persists, please %1$scontact our support team%2$s.","wordpress-seo"),"<a>","</a>"),{a:(0,de.jsx)(Le,{variant:"error",href:s})})})]})};ct.propTypes={errorMessage:G().string};const dt=({errorMessage:e=""})=>(0,de.jsxs)(i.Alert,{variant:"error",children:[(0,de.jsx)("span",{className:"yst-block yst-font-medium",children:lt}),(0,de.jsx)(ct,{errorMessage:e})]});dt.propTypes={errorMessage:G().string};const pt=(0,oe.__)("Something went wrong","wordpress-seo"),ut=()=>{const e=(0,t.useSelect)(e=>e(H).selectAdminLink("plugins.php"),[]);return(0,de.jsx)(Ue,{children:ae((0,oe.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. %2$s expands to an opening link tag. %3$s expands to a closing link tag. */ /* translators: %1$s expands to Yoast SEO Premium. %2$s expands to an opening link tag. %3$s expands to a closing link tag. */
(0,oe.__)("The version of %1$s is outdated. Please upgrade %1$s %2$shere%3$s!","wordpress-seo"),"Yoast SEO Premium","<a>","</a>"),{a:(0,de.jsx)(Le,{variant:"error",href:e})})})},ht=()=>(0,de.jsxs)(i.Alert,{variant:"error",children:[(0,de.jsx)("span",{className:"yst-block yst-font-medium",children:pt}),(0,de.jsx)(ut,{})]}),mt=({children:e})=>(0,de.jsx)("div",{className:"yst-mt-1 yst-text-sm yst-text-slate-500",children:e});mt.propTypes={children:G().node.isRequired};const gt=({children:e})=>(0,de.jsx)("div",{className:"yst-mt-6 yst-flex yst-flex-row yst-justify-end yst-gap-3",children:e});gt.propTypes={children:G().node.isRequired};const yt=({onClose:e})=>(0,de.jsx)(i.Button,{variant:"secondary",onClick:e,children:(0,oe.__)("Close","wordpress-seo")});yt.propTypes={onClose:G().func.isRequired};const xt=({showActions:e=!1,onRetry:t,onClose:s})=>(0,de.jsxs)(gt,{children:[(0,de.jsx)(yt,{onClose:s}),e&&(0,de.jsx)(i.Button,{variant:"primary",onClick:t,children:(0,oe.__)("Try again","wordpress-seo")})]});xt.propTypes={showActions:G().bool,onRetry:G().func.isRequired,onClose:G().func.isRequired};const wt=({isOpen:e,title:t,onClose:s=o.noop,children:r})=>{const n=(0,i.useSvgAria)();return(0,de.jsx)(i.Modal,{isOpen:e,onClose:s,children:(0,de.jsx)(i.Modal.Panel,{className:"yst-max-w-lg",closeButtonScreenReaderText:(0,oe.__)("Dismiss","wordpress-seo"),children:(0,de.jsxs)("div",{className:"yst-flex yst-items-start yst-gap-4",children:[(0,de.jsx)("div",{className:"yst-flex-shrink-0 yst-flex yst-items-center yst-justify-center yst-h-10 yst-w-10 yst-rounded-full yst-bg-red-100",children:(0,de.jsx)(Pe(),{className:"yst-h-6 yst-w-6 yst-text-red-600",...n})}),(0,de.jsxs)("div",{className:"yst-text-start yst-flex-1 yst-min-w-0",children:[(0,de.jsx)(i.Modal.Title,{className:"yst-text-lg yst-leading-6 yst-font-medium yst-text-slate-900",children:t}),r]})]})})})};wt.propTypes={isOpen:G().bool.isRequired,title:G().string.isRequired,onClose:G().func,children:G().node.isRequired};const ft=({isOpen:e=!0,showActions:t=!1,onRetry:s=o.noop,onClose:r=o.noop})=>(0,de.jsxs)(wt,{isOpen:e,title:Be,onClose:r,children:[(0,de.jsx)(mt,{children:(0,de.jsx)(Ge,{})}),(0,de.jsx)(xt,{showActions:t,onRetry:s,onClose:r})]});ft.propTypes={isOpen:G().bool,showActions:G().bool,onRetry:G().func,onClose:G().func};const vt=({isOpen:e=!0,showActions:t=!1,onRetry:s=o.noop,onClose:r=o.noop})=>(0,de.jsxs)(wt,{isOpen:e,title:st,onClose:r,children:[(0,de.jsx)(mt,{children:(0,de.jsx)(rt,{})}),(0,de.jsx)(xt,{showActions:t,onRetry:s,onClose:r})]});vt.propTypes={isOpen:G().bool,showActions:G().bool,onRetry:G().func,onClose:G().func};const bt=({errorMessage:e="",isOpen:t=!0,showActions:s=!1,onRetry:r=o.noop,onClose:i=o.noop})=>(0,de.jsxs)(wt,{isOpen:t,title:lt,onClose:i,children:[(0,de.jsx)(mt,{children:(0,de.jsx)(ct,{errorMessage:e})}),(0,de.jsx)(xt,{showActions:s,onRetry:r,onClose:i})]});bt.propTypes={errorMessage:G().string,isOpen:G().bool,showActions:G().bool,onRetry:G().func,onClose:G().func};const St=({isOpen:e=!0,onClose:t=o.noop})=>(0,de.jsxs)(wt,{isOpen:e,title:He,onClose:t,children:[(0,de.jsx)(mt,{children:(0,de.jsx)(ze,{})}),(0,de.jsx)(gt,{children:(0,de.jsx)(yt,{onClose:t})})]});St.propTypes={isOpen:G().bool,onClose:G().func};const jt=({isOpen:e=!0,onClose:t=o.noop})=>(0,de.jsxs)(wt,{isOpen:e,title:ot,onClose:t,children:[(0,de.jsx)(mt,{children:(0,de.jsx)(nt,{})}),(0,de.jsx)(gt,{children:(0,de.jsx)(yt,{onClose:t})})]});jt.propTypes={isOpen:G().bool,onClose:G().func};const Ct=({isOpen:e=!0,onClose:t=o.noop})=>(0,de.jsxs)(wt,{isOpen:e,title:Ze,onClose:t,children:[(0,de.jsx)(mt,{children:(0,de.jsx)(Xe,{})}),(0,de.jsx)(gt,{children:(0,de.jsx)(yt,{onClose:t})})]});Ct.propTypes={isOpen:G().bool,onClose:G().func};const kt=({isOpen:e=!0,onClose:t=o.noop})=>(0,de.jsxs)(wt,{isOpen:e,title:pt,onClose:t,children:[(0,de.jsx)(mt,{children:(0,de.jsx)(ut,{})}),(0,de.jsx)(gt,{children:(0,de.jsx)(yt,{onClose:t})})]});kt.propTypes={isOpen:G().bool,onClose:G().func};const _t=({invalidSubscriptions:e=[],isOpen:s=!0,onClose:r=o.noop})=>{const n=(0,t.useSelect)(e=>e(D).selectBustSubscriptionCacheEndpoint(),[]),a=(0,ne.useCallback)(async()=>{try{await p()({path:n,method:"POST",parse:!1})}catch(e){console.error(e)}window.location.reload()},[n]);return(0,de.jsxs)(wt,{isOpen:s,title:Qe,onClose:r,children:[(0,de.jsx)(mt,{children:(0,de.jsx)(et,{invalidSubscriptions:e})}),(0,de.jsxs)(gt,{children:[(0,de.jsx)(yt,{onClose:r}),(0,de.jsx)(i.Button,{variant:"primary",onClick:a,children:(0,oe.__)("Refresh page","wordpress-seo")})]})]})};_t.propTypes={invalidSubscriptions:G().arrayOf(G().string),isOpen:G().bool,onClose:G().func};const Et=({isOpen:e=!0,onClose:t=o.noop})=>{const s=(0,ne.useCallback)(()=>window.location.reload(),[]);return(0,de.jsxs)(wt,{isOpen:e,title:Ve,onClose:t,children:[(0,de.jsx)(mt,{children:(0,de.jsx)(Ke,{})}),(0,de.jsxs)(gt,{children:[(0,de.jsx)(yt,{onClose:t}),(0,de.jsx)(i.Button,{variant:"primary",onClick:s,children:(0,oe.__)("Refresh page","wordpress-seo")})]})]})};Et.propTypes={isOpen:G().bool,onClose:G().func};const Rt=(0,oe.__)("Yoast AI cannot reach your site","wordpress-seo"),It=()=>{const{commonErrorsLink:e,supportLink:t}=We();return(0,de.jsx)(Ue,{children:ae((0,oe.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ /* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */
(0,oe.__)("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,de.jsx)(Le,{variant:"error",href:e}),a2:(0,de.jsx)(Le,{variant:"error",href:t})})})},Lt=({learnMoreUrl:e=""})=>(0,de.jsx)(Ue,{children:ae((0,oe.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */
(0,oe.__)("%1$sLearn more about connecting with MyYoast.%2$s","wordpress-seo"),"<a>","</a>"),{a:(0,de.jsx)(Le,{variant:"error",href:e})})});Lt.propTypes={learnMoreUrl:G().string};const Tt=()=>{const e=(0,i.useSvgAria)(),{commonErrorsLink:s,supportLink:r}=(0,t.useSelect)(e=>{const t=e(H);return{commonErrorsLink:t.selectLink("https://yoa.st/ai-common-errors"),supportLink:t.selectAdminLink("?page=wpseo_page_support")}},[]);return(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(mt,{children:(0,de.jsx)(Ue,{children:(0,oe.__)("This feature requires a publicly accessible site. Check that your site (including any password-protected REST APIs or test environments) is visible to the public, then try again.","wordpress-seo")})}),(0,de.jsxs)(gt,{children:[(0,de.jsxs)(i.Button,{as:"a",href:r,target:"_blank",rel:"noopener noreferrer",variant:"secondary",children:[(0,oe.__)("Still need help?","wordpress-seo"),(0,de.jsx)(ce(),{className:"yst--me-1 yst-ms-1 yst-h-4 yst-w-4 yst-text-slate-400 rtl:yst-rotate-[270deg]",...e}),(0,de.jsx)("span",{className:"yst-sr-only",children:(0,oe.__)("(Opens in a new browser tab)","wordpress-seo")})]}),(0,de.jsxs)(i.Button,{as:"a",href:s,target:"_blank",rel:"noopener noreferrer",variant:"primary",children:[(0,oe.__)("Learn more","wordpress-seo"),(0,de.jsx)(me(),{className:"yst--me-1 yst-ms-1 yst-h-4 yst-w-4 rtl:yst-rotate-180",...e})]})]})]})},At=({isAvailable:e,canConnect:t,connectUrl:s,learnMoreUrl:r},o,n)=>e&&t&&s?(0,de.jsxs)(de.Fragment,{children:[(0,de.jsxs)(mt,{children:[(0,de.jsx)(Ue,{children:(0,oe.__)("This feature requires a publicly accessible site. Connect to MyYoast to use Yoast AI even when your site is offline, behind a firewall, or with the REST API disabled.","wordpress-seo")}),(0,de.jsx)(Lt,{learnMoreUrl:r})]}),(0,de.jsxs)(gt,{children:[(0,de.jsx)(yt,{onClose:o}),(0,de.jsxs)(i.Button,{as:"a",href:s,target:"_blank",rel:"noopener noreferrer",variant:"primary",children:[(0,oe.__)("Connect to MyYoast","wordpress-seo"),(0,de.jsx)(ce(),{className:"yst--me-1 yst-ms-1 yst-h-4 yst-w-4 rtl:yst-rotate-[270deg]",...n}),(0,de.jsx)("span",{className:"yst-sr-only",children:(0,oe.__)("(Opens in a new browser tab)","wordpress-seo")})]})]})]}):e&&!t?(0,de.jsxs)(de.Fragment,{children:[(0,de.jsxs)(mt,{children:[(0,de.jsx)(Ue,{children:(0,oe.__)("Your site isn't publicly accessible. Ask your site administrator to connect to MyYoast. They can find it on the Integrations page in Yoast SEO. This allows Yoast AI to work even when your site is offline, behind a firewall, or with the REST API disabled.","wordpress-seo")}),(0,de.jsx)(Lt,{learnMoreUrl:r})]}),(0,de.jsx)(gt,{children:(0,de.jsx)(yt,{onClose:o})})]}):(0,de.jsx)(Tt,{}),Mt=({isOpen:e=!0,onClose:s=o.noop})=>{const r=(0,i.useSvgAria)(),n=(0,t.useSelect)(e=>e(D).selectMyyoastConnection(),[]);return(0,de.jsx)(wt,{isOpen:e,title:Rt,onClose:s,children:At(n,s,r)})};Mt.propTypes={isOpen:G().bool,onClose:G().func};const Pt=({errorCode:e,errorIdentifier:t="",isOpen:s=!0,invalidSubscriptions:r=[],showActions:i=!1,onRetry:n=o.noop,errorMessage:a="",onClose:l=o.noop})=>{if("SEO_ANALYSIS_INACTIVE"===t)return(0,de.jsx)(Et,{isOpen:s,onClose:l});if(402===e||429===e&&"USAGE_LIMIT_REACHED"===t)return(0,de.jsx)(_t,{isOpen:s,invalidSubscriptions:r,onClose:l});switch(e){case 400:switch(t){case"AI_CONTENT_FILTER":return(0,de.jsx)(jt,{isOpen:s,onClose:l});case"NOT_ENOUGH_CONTENT":return(0,de.jsx)(St,{isOpen:s,onClose:l});case"SITE_UNREACHABLE":return(0,de.jsx)(Mt,{isOpen:s,onClose:l});case"WP_HTTP_REQUEST_ERROR":return(0,de.jsx)(bt,{isOpen:s,errorMessage:a,showActions:i,onRetry:n,onClose:l});default:return(0,de.jsx)(ft,{isOpen:s,showActions:i,onRetry:n,onClose:l})}case 408:return(0,de.jsx)(vt,{isOpen:s,showActions:i,onRetry:n,onClose:l});case 429:return(0,de.jsx)(Ct,{isOpen:s,onClose:l});case 410:return(0,de.jsx)(kt,{isOpen:s,onClose:l});default:return(0,de.jsx)(ft,{isOpen:s,showActions:i,onRetry:n,onClose:l})}};Pt.propTypes={errorCode:G().number.isRequired,errorIdentifier:G().string,isOpen:G().bool,invalidSubscriptions:G().arrayOf(G().string),showActions:G().bool,onRetry:G().func,errorMessage:G().string,onClose:G().func};var Nt=s(2863),Ot=s.n(Nt);const $t=window.yoast.aiFrontend,Ft=window.yoast.analysis,qt=(window.wp.sanitize,window.yoast.helpers),{stripHTMLTags:Ut}=qt.strings,Wt=["_formal","_informal","_ao90"],Bt=e=>{for(const t of Wt)if(e.endsWith(t))return e.slice(0,-t.length);return e};let Gt,Dt=!1;const Ht="\\–\\-\\(\\)_\\[\\]’‘“”〝〞〟‟„\"'.?!:;,¿¡«»‹›—×+&۔؟،؛。。!‼?⁇⁉⁈‥…・ー、〃〄〆〇〈〉《》「」『』【】〒〓〔〕〖〗〘〙〚〛〜〝〞〟〠〶〼〽{}|~⦅⦆「」、[]・¥$%@&'()*/:;<>\\\<>";Ht.split(""),new RegExp("^["+Ht+"]+"),new RegExp("["+Ht+"]+$");const zt=new RegExp("["+Ht+"#$%&*+/=@^`{|}~ -¿–-⁊ -₠-⃀]","g"),Yt=e=>0===e.replace(zt,"").trim().length,Vt=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},Kt=()=>{const e=(0,t.useSelect)(e=>e(H).getReplaceVars(),[]),s=(0,ne.useMemo)(()=>e.map(Vt),[e]);return(0,ne.useCallback)((e,{key:t="value",overrides:r={},applyPluggable:i=!0,editType:n=K,contentType:a=X}={})=>{for(const i of s)e=e.replace(new RegExp("%%"+(0,o.escapeRegExp)(i.name)+"%%","g"),(0,o.get)(r,i.name,i[t]));return a===J&&(e=e.replace(" Archives","")),i?((e,t=K)=>{const s=function(e){const t=(0,o.get)(window,["YoastSEO","app","pluggable"],!1);if(!t||!(0,o.get)(window,["YoastSEO","app","pluggable","loaded"],!1))return function(e){const t=(0,o.get)(window,["YoastSEO","wp","replaceVarsPlugin","replaceVariables"],o.identity);return{url:e.url,title:Ut(t(e.title)),description:Ut(t(e.description)),filteredSEOTitle:e.filteredSEOTitle?Ut(t(e.filteredSEOTitle)):""}}(e);const s=t._applyModifications.bind(t);return{url:e.url,title:Ut(s("data_page_title",e.title)),description:Ut(s("data_meta_desc",e.description)),filteredSEOTitle:e.filteredSEOTitle?Ut(s("data_page_title",e.filteredSEOTitle)):""}}({title:"",description:"",[t]:Ft.languageProcessing.stripSpaces(e)});return(0,o.get)(s,t,e)})(e,n):e},[s])},Zt={editType:K,previewType:z,postType:"post",contentType:X},Xt=(0,ne.createContext)(Zt),Jt=Xt.Provider,Qt=()=>(0,ne.useContext)(Xt),es=window.yoast.externals.contexts,ts=()=>(0,ne.useContext)(es.LocationContext),ss=e=>{const t=(0,ne.useRef)(null);return(0,ne.useCallback)(s=>{(0,o.attempt)(()=>t.current&&t.current.disconnect()),null!==s&&(t.current=new ResizeObserver(t=>{(0,o.forEach)(t,t=>e(t))}),t.current.observe(s))},[e])},rs=(0,n.createSlice)({name:"suggestions",initialState:{status:te.loading,error:{code:200,message:""},entities:[],selected:""},reducers:{setLoading:e=>{e.status=te.loading},setSuccess:(e,{payload:t})=>{e.status=te.success,e.selected=t[0],e.entities.push(...t)},setError:(e,{payload:t})=>{e.status=te.error,e.error=t},setSelected:(e,{payload:t})=>{e.selected=t}}}),is=e=>{switch(e){case Y:return"Facebook";case V:return"Twitter";default:return"Google"}},os=window.yoast.searchMetadataPreviews,ns="usageCount",as="fetchUsageCount",ls=`${as}/${I}`,cs=`${as}/${L}`,ds={errorCode:null,errorIdentifier:null,errorMessage:null},ps=(0,n.createSlice)({name:ns,initialState:{status:T,count:0,limit:10,endpoint:"",error:ds},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(`${as}/${R}`,e=>{e.status=A,e.error=ds}),e.addCase(ls,(e,{payload:t})=>{e.status=M,e.count=t.count,e.limit=t.limit,e.error=ds}),e.addCase(`${as}/${L}`,(e,{payload:t})=>{e.status=P,e.error={errorCode:502,...t}})}}),us=ps.getInitialState,hs={selectUsageCountStatus:e=>(0,o.get)(e,[ns,"status"],ps.getInitialState()),selectUsageCount:e=>(0,o.get)(e,[ns,"count"],ps.getInitialState().count),selectUsageCountLimit:e=>(0,o.get)(e,[ns,"limit"],ps.getInitialState().limit),selectUsageCountEndpoint:e=>(0,o.get)(e,[ns,"endpoint"],ps.getInitialState().endpoint),selectUsageCountError:e=>(0,o.get)(e,[ns,"error"],ps.getInitialState().error)};hs.selectUsageCountRemaining=(0,n.createSelector)([hs.selectUsageCount,hs.selectUsageCountLimit],(e,t)=>Math.max(t-e,0)),hs.isUsageCountLimitReached=(0,n.createSelector)([hs.selectUsageCount,hs.selectUsageCountLimit,hs.selectUsageCountError],(e,t,s)=>429===s.errorCode||e>=t);const ms={...ps.actions,fetchUsageCount:function*({endpoint:e,isWooProductEntity:t}){yield{type:`${as}/${R}`};try{const s=(e=>{const t=(0,o.get)(e,"totalUsed.license",null),s=(0,o.get)(e,"totalUsed.limit",null);if(!(0,o.isNumber)(t)||t<0)throw new Error("Invalid usage count: must be a number of zero or higher.");if(!(0,o.isNumber)(s)||s<-1||0===s)throw new Error("Invalid usage count limit: must be a number of -1 or higher than 1");return{count:t,limit:s}})(yield{type:as,payload:{endpoint:e,isWooProductEntity:t}});return{type:`${as}/${I}`,payload:s}}catch(e){return{type:`${as}/${L}`,payload:e}}}},gs={[as]:async({payload:e})=>p()({method:"POST",path:e.endpoint,data:{is_woo_product_entity:e.isWooProductEntity}})},ys=ps.reducer,xs=({onStartGenerating:e})=>(0,de.jsx)(qe,{storeName:D,linkStoreName:H,onConsentGranted:e});xs.propTypes={onStartGenerating:G().func.isRequired};var ws=s(7219),fs=s.n(ws);const vs=e=>{var s,r;const i=null===(s=(0,t.useDispatch)("core/edit-post"))||void 0===s?void 0:s.openGeneralSidebar,o=null===(r=(0,t.useDispatch)("core/editor"))||void 0===r?void 0:r.closePublishSidebar,{openEditorModal:n}=(0,t.useDispatch)("yoast-seo/editor");return(0,ne.useCallback)(()=>{o(),i("yoast-seo/seo-sidebar"),e&&n("yoast-search-appearance-modal")},[o,i,n])},bs=/(?<start><\/badge>|^(?!<badge>))(?<wrap>[\s\S]+?)(?<end><badge>|$)/g,Ss=({total:e,current:t,onNavigate:s,disabled:r=!1,...o})=>(0,de.jsxs)("div",{className:"yst-flex yst-justify-between yst-gap-x-2 yst-items-start",children:[(0,de.jsx)("p",{className:"yst-text-slate-500 yst-text-xxs yst-mt-1",children:(0,oe.__)("Text generated by AI may be offensive or inaccurate.","wordpress-seo")}),e>1&&(0,de.jsx)(i.Pagination,{className:"yst-shrink-0",current:t,total:e,onNavigate:s,disabled:r,variant:"text"
/* translators: Hidden accessibility text. */,screenReaderTextPrevious:(0,oe.__)("Previous","wordpress-seo")
/* translators: Hidden accessibility text. */,screenReaderTextNext:(0,oe.__)("Next","wordpress-seo"),...o})]}),js=({height:e,onFatalError:s})=>{const[r,n]=(0,ne.useState)(""),{onClose:a}=(0,i.useModalContext)(),{editType:l,previewType:c,contentType:d}=Qt(),u=(()=>{const{editType:e,previewType:t}=Qt();let s="SEO";switch(t){case Y:s="social";break;case V:s="X"}switch(e){case K:return(0,oe.sprintf)(/* translators: %s is the type of title. */ /* translators: %s is the type of title. */
(0,oe.__)("Generated %s titles","wordpress-seo"),s);case Z:return t===z&&(s="meta"),(0,oe.sprintf)(/* translators: %s is the type of description. */ /* translators: %s is the type of description. */
(0,oe.__)("Generated %s descriptions","wordpress-seo"),s)}})(),h=(()=>{const{editType:e,previewType:t}=Qt();let s="SEO";switch(t){case Y:s="social";break;case V:s="X"}switch(e){case K:return(0,oe.sprintf)(/* translators: %s is the type of title. */ /* translators: %s is the type of title. */
(0,oe.__)("Apply %s title","wordpress-seo"),s);case Z:return t===z&&(s="meta"),(0,oe.sprintf)(/* translators: %s is the type of description. */ /* translators: %s is the type of description. */
(0,oe.__)("Apply %s description","wordpress-seo"),s)}})(),m=ts(),{suggestions:g,fetchSuggestions:y,setSelectedSuggestion:x}=(()=>{const[e,s]=(0,ne.useReducer)(rs.reducer,rs.getInitialState()),{editType:r,previewType:i,postType:n,contentType:a}=Qt(),l=(0,t.useSelect)(e=>e(D).selectPromptContent(),[]),c=(0,t.useSelect)(e=>e(D).selectGetSuggestionsEndpoint(),[]),{contentLocale:d,focusKeyphrase:u,isWooCommerceActive:h,isGutenberg:m,isElementor:g}=(0,t.useSelect)(e=>({contentLocale:e(H).getContentLocale(),focusKeyphrase:e(H).getFocusKeyphrase(),isWooCommerceActive:e(H).getIsWooCommerceActive(),isGutenberg:e(H).getIsBlockEditor(),isElementor:e(H).getIsElementorEditor()}),[]);let y,x=Ft.languageProcessing.helpers.processExactMatchRequest(u).keyphrase;x.length>191&&(x=x.slice(0,191)),y=g?"elementor":m?"gutenberg":"classic";const w=((e,t,s,r)=>{const i=e===Z?"meta-description":"seo-title";let o=((e,t)=>{if(e)switch(t){case"product":return"product-";case"product_cat":case"product_tag":return"product-taxonomy-"}return""})(t,s);return o&&t||r!==J||(o="taxonomy-"),`${o}${i}`})(r,h,n,a);return{suggestions:e,fetchSuggestions:(0,ne.useCallback)(async(e=!0)=>{s(rs.actions.setLoading());const{status:t,payload:r}=await(async({endpoint:e,data:t})=>{let s;const r=1e3*(0,o.get)(window,"wpseoAiGenerator.requestTimeout",30);try{Gt&&Gt.abort(),Gt=new AbortController,Dt=!1,s=setTimeout(()=>{Dt=!0,Gt.abort()},r);const i=await p()({path:e,method:"POST",data:t,parse:!1,signal:Gt.signal}),o=await i.json();return{status:se,payload:o}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return Dt?{status:re,payload:{message:"timeout",code:408}}:{status:ie};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:re,payload:{message:t,code:e.status||500,missingLicenses:s,errorIdentifier:r}}}finally{clearTimeout(s)}})({endpoint:c,canAbort:e,data:{type:w,prompt_content:l,focus_keyphrase:x,platform:is(i),language:Bt(d).replace("_","-"),editor:y}});switch(t){case ie:break;case re:s(rs.actions.setError(r));break;case se:s(rs.actions.setSuccess(r))}return t},[s]),setSelectedSuggestion:(0,ne.useCallback)(e=>s(rs.actions.setSelected(e)),[s])}})(),w=(()=>{const{previewType:e}=Qt();switch(e){case Y:return Ps;case V:return Gr;default:return Is}})(),{addAppliedSuggestion:f,addUsageCount:v}=(0,t.useDispatch)(D),{isUsageCountLimitReached:b,isWooProductEntity:S,hasValidPremiumSubscription:j,hasValidWooSubscription:C}=(0,t.useSelect)(e=>{const t=e(D),s=e(H);return{isUsageCountLimitReached:t.isUsageCountLimitReached(),isPremium:s.getIsPremium(),isWooProductEntity:s.getIsWooProductEntity(),isWooSeoActive:s.getIsWooSeoActive(),hasValidPremiumSubscription:t.selectPremiumSubscription(),hasValidWooSubscription:t.selectWooCommerceSubscription()}},[]),k=(0,ne.useMemo)(()=>g.status===te.loading||!(C||!b||!S)||!(j||!b),[j,b,g.status,S,C]),_=(0,i.usePrevious)(e),E=g.status===te.success?e:_,{bottom:R}={bottom:`calc( (${E+"px"} - 100vh) / 2 + 32px )`},[I,L]=(0,ne.useState)(!1),T=(0,ne.useCallback)(e=>{L(e.target.offsetHeight!==e.target.scrollHeight)},[L]),A=ss(T),M=(()=>{const{editType:e,previewType:s,contentType:r}=Qt(),i=(()=>{const{previewType:e}=Qt();return(0,ne.useMemo)(()=>{switch(e){case z:return()=>(0,t.select)(H).getSnippetEditorData().title;case Y:return(0,t.select)(H).getFacebookTitleOrFallback;case V:return(0,t.select)(H).getTwitterTitleOrFallback;default:return(0,o.constant)("")}},[e])})(),n=(0,t.useSelect)(t=>t(D).selectAppliedSuggestionFor({editType:e,previewType:s}),[e,s]);return(0,ne.useMemo)(()=>{let t=i();return e===Z?t:(n&&(t=t.replace(n,ee[r])),((e,t)=>e.includes(ee[t])?e:ee[t])(t,r))},[e,i])})(),P=(()=>{const e=(()=>{const{previewType:e}=Qt();return(0,ne.useMemo)(()=>{switch(e){case z:return()=>(0,t.select)(H).getSnippetEditorData().description;case Y:return(0,t.select)(H).getFacebookDescriptionOrFallback;case V:return(0,t.select)(H).getTwitterDescriptionOrFallback;default:return(0,o.constant)("")}},[e])})();return(0,ne.useMemo)(e,[e])})(),N=Kt(),O=(0,ne.useMemo)(()=>l===K?{[Q[d]]:g.selected}:{},[l,d,g.selected]),$=(0,ne.useMemo)(()=>N(M,{overrides:O,contentType:d}),[N,M,l,d,g.selected]),F=(0,ne.useMemo)(()=>N(M,{overrides:{...O,sep:"",sitename:""},contentType:d}),[N,M,l,d,g.selected]),q=(0,ne.useMemo)(()=>l===Z?g.selected:N(P,{editType:Z}),[N,P,l,g.selected]),U=(0,ne.useCallback)(e=>N(M,{overrides:{[Q[d]]:e},key:"badge",applyPluggable:!1,contentType:d}),[N,M,d]),{currentPage:W,setCurrentPage:B,isOnLastPage:G,totalPages:X,getItemsOnCurrentPage:le}=(({totalItems:e=0,perPage:t=5})=>{const[s,r]=(0,ne.useState)(1),i=(0,ne.useMemo)(()=>Math.ceil(e/t),[e,t]),n=(0,ne.useMemo)(()=>s*t,[s,t]),a=(0,ne.useMemo)(()=>n-t,[n,t]),l=(0,ne.useMemo)(()=>1===s,[s]),c=(0,ne.useMemo)(()=>s===i,[s,i]),d=(0,ne.useCallback)(()=>{s>1&&r(s-1)},[s,r]),p=(0,ne.useCallback)(()=>{s<i&&r(s+1)},[s,r,i]),u=(0,ne.useCallback)(e=>(0,o.slice)(e,a,n),[a,n]);return{currentPage:s,setCurrentPage:r,totalPages:i,isOnFirstPage:l,isOnLastPage:c,previousPage:d,nextPage:p,firstOnPage:a,lastOnPage:n,getItemsOnCurrentPage:u}})({totalItems:g.status===te.loading||g.status===te.error?g.entities.length+5:g.entities.length,perPage:5}),ce=(0,ne.useMemo)(()=>(0,o.map)(le(g.entities),e=>{let t=e;return l===K&&(t=U(e),t=t.replace(bs,(e,t,s,r,i,o,{start:n,wrap:a,end:l})=>{const c=a.trim();return 0===c.length?`${n}${a}${l}`:`${n}<span>${c}</span>${l}`}),t=ae(t,{badge:(0,de.jsx)(i.Badge,{className:"yst-me-2 last:yst-me-0",variant:"plain",children:" "}),span:(0,de.jsx)("span",{className:"yst-flex yst-items-center yst-me-2 last:yst-me-0"})})),{value:e,label:t}}),[g.entities,le,l,U]),pe=(0,ne.useMemo)(()=>g.status!==te.error||g.status===te.error&&!G,[g.status,G]),ue=(0,ne.useMemo)(()=>g.status===te.loading&&G,[g.status,G]),he=(0,ne.useMemo)(()=>g.status===te.error&&G,[g.status,G]),me=(0,ne.useCallback)(()=>{k||(B(g.status===te.error?X:X+1),y().then(e=>{e===se&&v()}))},[y,g.status,X,B,x,b]),ge=(()=>{const{editType:e}=Qt();switch(e){case K:return(()=>{const{previewType:e}=Qt(),{updateData:s,setFacebookPreviewTitle:r,setTwitterPreviewTitle:i}=(0,t.useDispatch)(H);return(0,ne.useMemo)(()=>{switch(e){case z:return e=>s({title:e});case Y:return r;case V:return i;default:return o.noop}},[e,s,r,i])})();case Z:return(()=>{const{previewType:e}=Qt(),{updateData:s,setFacebookPreviewDescription:r,setTwitterPreviewDescription:i}=(0,t.useDispatch)(H);return(0,ne.useMemo)(()=>{switch(e){case z:return e=>s({description:e});case Y:return r;case V:return i;default:return o.noop}},[e,s,r,i])})();default:return o.noop}})(),ye=vs(!0),xe=(0,ne.useCallback)(()=>{const e=l===K?M.replace(new RegExp(ee[d]+"( Archives)?"),g.selected):g.selected;ge(e),f({editType:l,previewType:c,suggestion:g.selected}),a(),"pre-publish"===m&&ye()},[ge,l,c,g.selected,M,a,f,ye,m]);((e,t=[])=>{const s=(0,ne.useRef)(!1);(0,ne.useEffect)(()=>{s.current||(s.current=!0,e().finally(()=>{s.current=!1}))},[e,t])})(()=>""===r?y().then(e=>{n(e),e===se&&v()}):Promise.resolve(),[r,v,y]);const we=r===re||g.status===te.error&&402===g.error.code;return(0,ne.useEffect)(()=>{var e,t,r,i,o,n,a,l;we&&s({errorCode:null!==(e=null===(t=g.error)||void 0===t?void 0:t.code)&&void 0!==e?e:0,errorIdentifier:null!==(r=null===(i=g.error)||void 0===i?void 0:i.errorIdentifier)&&void 0!==r?r:"",invalidSubscriptions:null!==(o=null===(n=g.error)||void 0===n?void 0:n.missingLicenses)&&void 0!==o?o:[],errorMessage:null!==(a=null===(l=g.error)||void 0===l?void 0:l.message)&&void 0!==a?a:""})},[we,g.error,s]),we?null:(0,de.jsxs)(ne.Fragment,{children:[(0,de.jsxs)(i.Modal.Container.Content,{ref:A,className:"yst-flex yst-flex-col yst-py-6 yst-space-y-2",children:[(0,de.jsx)(w,{title:$,description:q,status:g.status,titleForLength:F,showPreviewSkeleton:""===r,showLengthProgress:!ue}),pe&&(0,de.jsxs)(de.Fragment,{children:[(0,de.jsxs)("div",{className:"yst-flex yst-space-y-4",children:[(0,de.jsx)(i.Label,{as:"span",className:"yst-flex-grow yst-cursor-default yst-mt-auto",children:u}),(0,de.jsx)(i.Button,{variant:"ai-secondary",size:"small",onClick:g.status===te.loading?o.noop:me,isLoading:g.status===te.loading,disabled:k,children:(0,oe.__)("Generate 5 more","wordpress-seo")})]}),ue?(0,de.jsx)(Ur,{idSuffix:m,suggestionClassNames:l===K?[["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,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(Fr,{idSuffix:m,suggestions:ce,selected:g.selected,onChange:x}),(0,de.jsx)(Ss,{current:W,total:X,onNavigate:B,disabled:g.status===te.loading||he})]})]}),he&&(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)("div",{className:"yst-mt-8"}),(0,de.jsx)(Nr,{errorCode:g.error.code,errorIdentifier:g.error.errorIdentifier,invalidSubscriptions:g.error.missingLicenses,errorMessage:g.error.message}),(0,de.jsx)(Ss,{current:W,total:X,onNavigate:B,disabled:g.status===te.loading})]})]}),(0,de.jsxs)(i.Modal.Container.Footer,{children:[I&&(0,de.jsx)("div",{className:"yst-absolute yst-inset-x-0 yst--mt-10 yst-me-[calc(2.5rem-1px)] yst-h-10 yst-pointer-events-none yst-bg-gradient-to-t yst-from-slate-50"}),(0,de.jsx)("hr",{className:"yst-mb-6 yst--mx-6"}),(0,de.jsxs)("div",{className:"sm:yst-flex sm:yst-justify-end sm:yst-space-x-2 sm:rtl:yst-space-x-reverse",children:[(0,de.jsx)("div",{className:"yst-hidden sm:yst-inline",children:(0,de.jsx)(i.Button,{variant:"secondary",onClick:a,children:(0,oe.__)("Close","wordpress-seo")})}),(0,de.jsx)("div",{className:"yst-block sm:yst-inline",children:(0,de.jsxs)(i.Button,{className:"yst-w-full sm:yst-w-auto",variant:"primary",onClick:xe,disabled:""===g.selected||g.status===te.loading||he,children:[(0,de.jsx)(fs(),{className:"yst--ms-1 yst-me-1 yst-h-4 yst-w-4 yst-text-white"}),h]})}),(0,de.jsx)("div",{className:"yst-mt-3 sm:yst-hidden",children:(0,de.jsx)(i.Button,{variant:"secondary",onClick:a,className:"yst-w-full sm:yst-w-auto",children:(0,oe.__)("Close","wordpress-seo")})})]})]}),(0,de.jsxs)(i.Notifications,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all",style:{bottom:R},position:"bottom-left",children:[g.status!==te.loading&&(0,de.jsx)(Zr,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all"}),(g.status===te.success||g.status===te.loading)&&(0,de.jsx)(Br,{})]})]})};js.propTypes={height:G().number.isRequired,onFatalError:G().func.isRequired};const Cs=({onActivateFreeSparks:e})=>{const{premiumUpsellLink:s,wooUpsellLink:r,isWooCommerceActive:o,isProductPost:n,learnMoreLink:a,imageLink:l,wistiaEmbedPermissionValue:c,wistiaEmbedPermissionStatus:d,isUsageCountLimitReached:p,activateFreeSparksEndpoint:u}=(0,t.useSelect)(e=>{const t=e(D),s=e(H);return{premiumUpsellLink:s.selectLink("https://yoa.st/ai-generator-upsell"),wooUpsellLink:s.selectLink("https://yoa.st/ai-generator-upsell-woo-seo"),isWooCommerceActive:s.getIsWooCommerceActive(),isProductPost:s.getIsProduct(),learnMoreLink:s.selectLink("https://yoa.st/ai-generator-learn-more"),imageLink:s.selectImageLink("ai-generator-preview.jpg"),wistiaEmbedPermissionValue:s.selectWistiaEmbedPermissionValue(),wistiaEmbedPermissionStatus:s.selectWistiaEmbedPermissionStatus(),isUsageCountLimitReached:t.isUsageCountLimitReached(),activateFreeSparksEndpoint:t.selectFreeSparksActiveEndpoint()}},[]),{onClose:h,initialFocus:m}=(0,i.useModalContext)(),{title:g,upsellLabel:y,upsellLink:x,ctbId:w,newToText:f}=(e=>{const{isWooProductEntity:s,isProductPost:r,hasValidWooSubscription:i}=(0,t.useSelect)(e=>{const t=e(H),s=e(D);return{isWooProductEntity:t.getIsWooProductEntity(),isProductPost:t.getIsProduct(),hasValidWooSubscription:s.selectWooCommerceSubscription()}},[]);return(0,ne.useMemo)(()=>{const t={upsellLink:e.premium,upsellLabel:(0,oe.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. */ /* translators: %1$s expands to Yoast SEO Premium. */
(0,oe.__)("Unlock with %1$s","wordpress-seo"),"Yoast SEO Premium"),newToText:"Yoast SEO Premium",ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2",title:(0,oe.__)("Use AI to generate your titles & descriptions!","wordpress-seo")};return s&&(r&&(t.title=(0,oe.__)("Generate product titles & descriptions with AI!","wordpress-seo")),i||(t.newToText="Yoast WooCommerce SEO",t.upsellLabel=(0,oe.sprintf)(/* translators: %1$s expands to Yoast WooCommerce SEO. */ /* translators: %1$s expands to Yoast WooCommerce SEO. */
(0,oe.__)("Unlock with %1$s","wordpress-seo"),"Yoast WooCommerce SEO"),t.upsellLink=e.woo,t.ctbId="5b32250e-e6f0-44ae-ad74-3cefc8e427f9")),t},[s,r,e.premium,e.woo])})({premium:s,woo:r}),v=(0,ne.useMemo)(()=>o&&n,[o,n]),b=(0,ne.useMemo)(()=>({src:l,width:"432",height:"244"}),[l]),{setWistiaEmbedPermission:S}=(0,t.useDispatch)(H),{activateFreeSparks:j}=(0,t.useDispatch)(D),C=(0,ne.useMemo)(()=>({value:c,status:d,set:S}),[c,d,S]),k=(0,ne.useCallback)(()=>{j({endpoint:u}),e()},[j,u,h,e]),_={a:(0,de.jsx)(Le,{href:a,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,de.jsx)(me(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"})};return(0,de.jsxs)(de.Fragment,{children:[(0,de.jsxs)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center",children:[(0,de.jsxs)("div",{className:"yst-relative yst-w-full",children:[(0,de.jsx)(Oe,{videoId:"vmrahpfjxp",thumbnail:b,wistiaEmbedPermission:C}),(0,de.jsx)(i.Badge,{className:"yst-absolute yst--top-2 yst-end-4",variant:"info",children:"Beta"})]}),(0,de.jsx)("div",{className:"yst-mt-6 yst-text-xs yst-font-medium yst-flex yst-flex-col yst-items-center",children:(0,de.jsxs)("span",{className:"yst-introduction-modal-uppercase yst-flex yst-gap-2 yst-items-center",children:[(0,de.jsx)("span",{className:"yst-logo-icon"}),f]})})]}),(0,de.jsxs)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center",children:[(0,de.jsxs)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center",children:[(0,de.jsx)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium",children:g}),(0,de.jsx)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm",children:ae(v?(0,oe.sprintf)(/* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */ /* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */
(0,oe.__)("Let AI do some of the thinking for you and help you save time. Get high-quality suggestions for product titles and meta descriptions to make your content rank high and look good on social media. %1$sLearn more%2$s%3$s","wordpress-seo"),"<a>","<ArrowNarrowRightIcon />","</a>"):(0,oe.sprintf)(/* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */ /* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */
(0,oe.__)("Let AI do some of the thinking for you and help you save time. Get high-quality suggestions for titles and meta descriptions to make your content rank high and look good on social media. %1$sLearn more%2$s%3$s","wordpress-seo"),"<a>","<ArrowNarrowRightIcon />","</a>"),_)})]}),p&&(0,de.jsx)(i.Alert,{className:"yst-my-4",children:(0,oe.sprintf)(/* translators: %s is for Yoast SEO Premium. */ /* translators: %s is for Yoast SEO Premium. */
(0,oe.__)("Oh no! Its seems like you're out of free Sparks. Keep the momentum going, unlock unlimited sparks with %s!","wordpress-seo"),"Yoast SEO Premium")}),(0,de.jsxs)("div",{className:Ae()("yst-w-full yst-flex yst-flex-col",p?"yst-mt-0":"yst-mt-6"),children:[(0,de.jsxs)(i.Button,{as:"a",className:"yst-grow",size:"extra-large",variant:"upsell",href:x,target:"_blank",ref:m,"data-action":"load-nfd-ctb","data-ctb-id":w,children:[(0,de.jsx)(ue(),{className:"yst--ms-1 yst-me-2 yst-h-5 yst-w-5"}),y,(0,de.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,oe.__)("(Opens in a new browser tab)","wordpress-seo")})]}),!p&&(0,de.jsx)(i.Button,{variant:"ai-secondary",onClick:k,className:"yst-mt-2 yst-w-full yst-text-base yst-text-slate-800 yst-font-medium yst-h-11",children:(0,oe.__)("Try for free","wordpress-seo")})]}),(0,de.jsx)(i.Button,{as:"a",className:"yst-mt-4",variant:"tertiary",onClick:h,children:(0,oe.__)("Close","wordpress-seo")})]})]})},ks=({isOpen:e,onClose:t,closeButtonScreenReaderText:s,panelRef:r,title:o,aiModalHelperLink:n,children:a})=>{const l=(0,i.useSvgAria)();return(0,de.jsx)(i.Modal,{className:"yst-ai-modal",isOpen:e,onClose:t,children:(0,de.jsx)(i.Modal.Panel,{ref:r,className:"yst-max-w-3xl yst-relative",closeButtonScreenReaderText:s,children:(0,de.jsxs)(i.Modal.Container,{children:[(0,de.jsxs)(i.Modal.Container.Header,{children:[(0,de.jsxs)("div",{className:"yst-flex yst-items-center",children:[(0,de.jsx)("span",{className:"yst-logo-icon yst-h-5 yst-w-5"}),(0,de.jsx)(i.Modal.Title,{className:"yst-ms-3 yst-me-1.5",as:"h1",size:"2",children:o}),(0,de.jsx)(i.Link,{id:"ai-modal-learn-more",href:n,variant:"primary",className:"yst-no-underline yst-me-2",target:"_blank",rel:"noopener"
/* translators: Hidden accessibility text. */,"aria-label":(0,oe.__)("Learn more about AI (Opens in a new browser tab)","wordpress-seo"),children:(0,de.jsx)(Ot(),{...l,className:"yst-w-4 yst-h-4 yst-text-slate-500 yst-shrink-0"})}),(0,de.jsx)(i.Badge,{variant:"info",children:(0,oe.__)("Beta","wordpress-seo")})]}),(0,de.jsx)("hr",{className:"yst-mt-6 yst--mx-6"})]}),a]})})})},_s=({isOpen:e,onClose:t,closeButtonScreenReaderText:s,children:r})=>(0,de.jsx)(i.Modal,{className:"yst-introduction-modal",isOpen:e,onClose:t,children:(0,de.jsx)(i.Modal.Panel,{className:"yst-max-w-lg yst-p-0 yst-rounded-3xl",closeButtonScreenReaderText:s,children:r})}),Es={inactive:"inactive",askConsent:"askConsent",upsell:"upsell",generate:"generate"},Rs=({onUseAi:e})=>{const[s,r]=(0,ne.useState)(Es.inactive),{editType:o,previewType:n}=Qt(),a=ts(),l=(()=>{const{editType:e,previewType:t}=Qt();switch(t){case Y:return e===Z?(0,oe.__)("AI social description generator","wordpress-seo"):(0,oe.__)("AI social title generator","wordpress-seo");case V:return e===Z?(0,oe.__)("AI X description generator","wordpress-seo"):(0,oe.__)("AI X title generator","wordpress-seo");default:return e===Z?(0,oe.__)("AI description generator","wordpress-seo"):(0,oe.__)("AI title generator","wordpress-seo")}})(),{hasConsent:c,promptContentInitialized:d,currentSubscriptions:p,usageCountStatus:u,usageCount:h,usageCountLimit:m,usageCountEndpoint:g,hasValidPremiumSubscription:y,hasValidWooSubscription:x,focusKeyphrase:w,isPremium:f,isSeoAnalysisActive:v,aiModalHelperLink:b,isWooProductEntity:S,isFreeSparksActive:j,isWooSeoActive:C}=(0,t.useSelect)(e=>{const t=e(D),s=e(H);return{hasConsent:t.selectHasAiGeneratorConsent(),promptContentInitialized:t.selectPromptContentInitialized(),currentSubscriptions:t.selectProductSubscriptions(),usageCountStatus:t.selectUsageCountStatus(),usageCount:t.selectUsageCount(),usageCountLimit:t.selectUsageCountLimit(),usageCountEndpoint:t.selectUsageCountEndpoint(),hasValidPremiumSubscription:t.selectPremiumSubscription(),hasValidWooSubscription:t.selectWooCommerceSubscription(),focusKeyphrase:s.getFocusKeyphrase(),isPremium:s.getIsPremium(),isWooSeoActive:s.getIsWooSeoActive(),isSeoAnalysisActive:s.getPreference("isKeywordAnalysisActive",!0),aiModalHelperLink:s.selectLink("https://yoa.st/ai-generator-help-button-modal"),isWooProductEntity:s.getIsWooProductEntity(),isFreeSparksActive:e(D).selectIsFreeSparksActive()}},[]),{fetchUsageCount:k}=(0,t.useDispatch)(D),{closeEditorModal:_}=(0,t.useDispatch)(H),E=(0,oe.__)("Close modal","wordpress-seo"),[R,I]=(0,ne.useState)(!1),[L,T]=(0,ne.useState)(0),M=(0,ne.useCallback)(e=>T(e.borderBoxSize[0].blockSize),[T]),N=ss(M),[O,$]=(0,ne.useState)(null),F=(0,ne.useCallback)(({currentSubscriptions:e,isSeoAnalysisActive:s})=>{const r=(e=>{const s=(0,t.select)(H),r=[];return((e,t)=>(e.getIsPremium()||e.getIsWooProductEntity())&&!t.premiumSubscription)(s,e)&&r.push("Yoast SEO Premium"),((e,t)=>e.getIsWooProductEntity()&&e.getIsWooSeoActive()&&!t.wooCommerceSubscription)(s,e)&&r.push("Yoast WooCommerce SEO"),r})(e);return r.length>0?{errorCode:402,errorIdentifier:"",invalidSubscriptions:r,errorMessage:""}:s?(()=>{var e,s;const r=(0,t.select)(D);if(r.selectUsageCountStatus()!==P)return null;const i=r.selectUsageCountError();return{errorCode:i.errorCode,errorIdentifier:null!==(e=i.errorIdentifier)&&void 0!==e?e:"",invalidSubscriptions:[],errorMessage:null!==(s=i.errorMessage)&&void 0!==s?s:""}})():{errorCode:0,errorIdentifier:"SEO_ANALYSIS_INACTIVE",invalidSubscriptions:[],errorMessage:""}},[]),q=(0,ne.useCallback)(()=>{r(Es.inactive)},[]),U=(0,ne.useCallback)(()=>$(null),[]),W=(0,ne.useCallback)(()=>{$(null),r(Es.generate)},[]),B=(0,ne.useCallback)(()=>{$(F({currentSubscriptions:p,isSeoAnalysisActive:v})),r(Es.inactive)},[F,p,v]),G=(0,ne.useCallback)(e=>{$(e),r(Es.inactive)},[]),z={onClose:q,closeButtonScreenReaderText:E},K=(0,ne.useCallback)(()=>!Yt(w),[w]),X=vs(!1),J=(0,ne.useCallback)(()=>{_(),"pre-publish"===a&&X(),setTimeout(()=>(e=>{const t=`focus-keyword-input-${["modal","pre-publish"].includes(e)?"sidebar":e}`;if("metabox"===e){const e=document.getElementById("wpseo-meta-tab-content");e&&e.click()}const s=document.getElementById(t);s&&s.focus()})(a),0)},[_,a,X]),Q=(0,ne.useCallback)(()=>S?x&&y:y,[y,x,S]),ee=(0,ne.useCallback)(async()=>{if(e(),!v)return void B();if(!K())return r(Es.inactive),void J();const t=Q();if(!t&&f&&C&&S)return void B();if(!t&&f&&!S)return void B();if(!c&&(j||t))return void r(Es.askConsent);I(!0);const{type:s,payload:i}=await k({endpoint:g,isWooProductEntity:S}),o=429===(null==i?void 0:i.errorCode)&&!(null!=i&&i.errorIdentifier)&&0===(null==i?void 0:i.missingLicenses.length),n=429===(null==i?void 0:i.errorCode)&&"USAGE_LIMIT_REACHED"===(null==i?void 0:i.errorIdentifier)||i.count>=i.limit;I(!1),o?B():403!==(null==i?void 0:i.errorCode)||!j&&!t?s!==cs||429===(null==i?void 0:i.errorCode)||403===(null==i?void 0:i.errorCode)?s===cs&&429===(null==i?void 0:i.errorCode)&&t?B():!t&&!j||!t&&n?r(Es.upsell):(t&&c&&r(Es.generate),!t&&j&&!n&&c&&r(Es.generate)):B():r(Es.askConsent)},[e,f,j,c,v,K,J,B,g,k,C,S,R]),te=(0,ne.useCallback)(async()=>{const{type:e,payload:t}=await k({endpoint:g,isWooProductEntity:S}),s=429===(null==t?void 0:t.errorCode)||t.count>=t.limit,i=Q();!s||i?e!==cs?r(Es.generate):B():r(Es.upsell)},[r,B,g,k,Q,S]),se=(0,ne.useCallback)(()=>{r(c?Es.generate:Es.askConsent)},[r,c]),re=(0,ne.useMemo)(()=>"google"===n?"title"===o?(0,oe.__)("Generate SEO title","wordpress-seo"):(0,oe.__)("Generate meta description","wordpress-seo"):"social"===n||"twitter"===n?"title"===o?(0,oe.__)("Generate social title","wordpress-seo"):(0,oe.__)("Generate social description","wordpress-seo"):void 0,[n,o]);return(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(i.Button,{type:"button",variant:"ai-secondary",size:"small",id:`yst-replacevar__use-ai-button__${o}__${a}`,onClick:ee,disabled:u===A||!d,isLoading:R&&u===A,children:re}),(0,de.jsxs)(_s,{...z,isOpen:[Es.askConsent,Es.upsell].includes(s),children:[s===Es.askConsent&&(0,de.jsx)(xs,{onStartGenerating:te}),s===Es.upsell&&(0,de.jsx)(Cs,{onActivateFreeSparks:se})]}),(0,de.jsx)(ks,{...z,isOpen:s===Es.generate,aiModalHelperLink:b,panelRef:N,title:l,children:s===Es.generate&&(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)($t.UsageCounter,{limit:m,requests:h,isSkeleton:!1,className:"yst-absolute yst-top-[-11px] yst-end-12 sm:yst-end-16",mentionBetaInTooltip:f,mentionResetInTooltip:f}),(0,de.jsx)(js,{height:L,onFatalError:G})]})}),O&&(0,de.jsx)(Pt,{isOpen:!0,errorCode:O.errorCode,errorIdentifier:O.errorIdentifier,invalidSubscriptions:O.invalidSubscriptions,errorMessage:O.errorMessage,showActions:!0,onRetry:W,onClose:U})]})};Rs.propTypes={onUseAi:G().func.isRequired};const Is=({title:e,description:s,status:r,titleForLength:o,showPreviewSkeleton:n,showLengthProgress:a})=>{const l=(0,t.useSelect)(e=>e(H).getSnippetEditorMode(),[]),[c,d]=(0,ne.useState)(l),{editType:p}=Qt(),u=ts(),h=(({editType:e,title:s,description:r})=>{const i=(0,t.useSelect)(e=>e(H).getDateFromSettings(),[]),o=(0,t.useSelect)(e=>e(H).getContentLocale(),[]),n=(0,t.useSelect)(e=>e(H).isCornerstoneContent(),[]),a=(0,t.useSelect)(e=>e(H).getIsTerm(),[]);return(0,ne.useMemo)(()=>e===Z?(0,os.getDescriptionProgress)(r,i,n,a,o):(0,os.getTitleProgress)(s),[e,s,r,i,n,a,o])})({editType:p,title:o,description:s});return(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(os.ModeSwitcher,{onChange:d,active:c,id:`yst-ai-google-preview-mode-switcher-${u}`,disabled:r===te.loading}),n?(0,de.jsx)(As,{}):(0,de.jsx)(Ts,{mode:c,title:e,description:s}),(0,de.jsxs)("div",{className:"yst-pt-4",children:[(0,de.jsx)(i.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:p===K?(0,oe.__)("SEO title width","wordpress-seo"):(0,oe.__)("Meta description length","wordpress-seo")}),(0,de.jsx)(Ms,{className:"yst-mt-2",progress:a?h.actual:0,min:0,max:h.max,score:h.score})]})]})};Is.propTypes={title:G().string.isRequired,description:G().string.isRequired,status:G().oneOf(Object.keys(te)).isRequired,titleForLength:G().string.isRequired,showPreviewSkeleton:G().bool.isRequired,showLengthProgress:G().bool.isRequired};const Ls=/mobi/i,Ts=({mode:e,title:s,description:r})=>{var i,n;const a=(0,t.useSelect)(e=>e(H).getBaseUrlFromSettings(),[]),l=(0,t.useSelect)(e=>e(H).getSnippetEditorData().slug||"",[]),c=(0,t.useSelect)(e=>e(H).getDateFromSettings(),[]),d=(0,t.useSelect)(e=>e(H).getFocusKeyphrase(),[]),p=(0,t.useSelect)(e=>e(H).getSnippetEditorPreviewImageUrl(),[]),u=(0,t.useSelect)(e=>e(H).getSiteIconUrlFromSettings(),[]),h=(0,t.useSelect)(e=>e(H).getShoppingData(),[]),m=(0,t.useSelect)(e=>e(H).getSnippetEditorWordsToHighlight(),[]),g=(0,t.useSelect)(e=>e(H).getSiteName(),[]),y=(0,t.useSelect)(e=>e(H).getContentLocale(),[]),x=(0,ne.useMemo)(()=>a+l,[a,l]),w=(0,ne.useMemo)(()=>{var e,t;return Ls.test(null===(e=window)||void 0===e||null===(t=e.navigator)||void 0===t?void 0:t.userAgent)},[null===(i=window)||void 0===i||null===(n=i.navigator)||void 0===n?void 0:n.userAgent]);return(0,de.jsx)("div",{className:`yst-ai-generator-preview-section ${e}${w?" yst-user-agent__mobile":""}`,children:(0,de.jsx)(os.SnippetPreview,{title:s,description:r,mode:e,url:x,keyword:d,date:c,faviconSrc:u,mobileImageSrc:p,wordsToHighlight:m,siteName:g,locale:y,shoppingData:h,onMouseUp:o.noop})})};Ts.propTypes={mode:G().oneOf(Object.keys({mobile:"mobile",desktop:"desktop"})).isRequired,title:G().string.isRequired,description:G().string.isRequired};const As=()=>(0,de.jsxs)("div",{className:"yst-max-w-[400px] yst-py-4 yst-px-3 yst-border yst-rounded-lg yst-w-full yst-mx-auto",children:[(0,de.jsxs)("div",{className:"yst-flex yst-gap-x-3",children:[(0,de.jsx)(i.SkeletonLoader,{className:"yst-flex-shrink-0 yst-h-7 yst-w-7 yst-rounded-full"}),(0,de.jsxs)("div",{className:"yst-flex yst-flex-col yst-w-full yst-gap-y-1",children:[(0,de.jsx)(i.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,de.jsx)(i.SkeletonLoader,{className:"yst-h-2.5 yst-w-10/12"})]})]}),(0,de.jsx)(i.SkeletonLoader,{className:"yst-h-4 yst-w-full yst-mt-6 yst-mb-4"}),(0,de.jsx)(i.SkeletonLoader,{className:"yst-h-3 yst-w-full"}),(0,de.jsx)(i.SkeletonLoader,{className:"yst-h-3 yst-w-10/12 yst-mt-2.5"})]}),Ms=({className:e="",progress:t,max:s,score:r})=>{const o=(0,ne.useMemo)(()=>(e=>e>=7?"yst-score-good":e>=5?"yst-score-ok":"yst-score-bad")(r),[r]);return(0,de.jsx)(i.ProgressBar,{className:Ae()("yst-length-progress-bar",o,e),progress:t,min:0,max:s})};Ms.propTypes={className:G().string,progress:G().number.isRequired,max:G().number.isRequired,score:G().number.isRequired};const Ps=({title:e,description:t,showPreviewSkeleton:s})=>(0,de.jsxs)("div",{children:[(0,de.jsx)("div",{className:"yst-flex yst-mb-6",children:(0,de.jsx)(i.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:(0,oe.__)("Social preview","wordpress-seo")})}),s?(0,de.jsx)(Ar,{}):(0,de.jsx)(Tr,{title:e,description:t})]});Ps.propTypes={title:G().string.isRequired,description:G().string.isRequired,showPreviewSkeleton:G().bool.isRequired};const Ns=window.yoast.styledComponents;var Os=s.n(Ns);const $s=Os().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"};
`,Fs=e=>{const{siteUrl:t}=e;return(0,de.jsxs)(we.Fragment,{children:[(0,de.jsx)("span",{className:"screen-reader-text",children:t}),(0,de.jsx)($s,{"aria-hidden":"true",children:(0,de.jsx)("span",{children:t})})]})};Fs.propTypes={siteUrl:G().string.isRequired};const qs=Fs,Us=window.yoast.socialMetadataForms,Ws=window.yoast.styleGuide,Bs=Os().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;
	}
`,Gs=Os().img`
	&& {
		height: 100%;
		position: absolute;
		width: 100%;
		object-fit: cover;
	}
`,Ds=Os().div`
	padding-bottom: ${e=>e.aspectRatio}%;
`,Hs=({imageProps:e,width:t,height:s,imageMode:r="landscape"})=>"landscape"===r?(0,de.jsx)(Ds,{aspectRatio:e.aspectRatio,children:(0,de.jsx)(Gs,{src:e.src,alt:e.alt})}):(0,de.jsx)(Bs,{src:e.src,alt:e.alt,width:t,height:s,imageProperties:e});function zs(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 Ys(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 Vs(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 i=s?"landscape":"square";"Facebook"===t&&(i=(0,Us.determineFacebookImageMode)(r));const o=function(e){return"Twitter"===e?Us.TWITTER_IMAGE_SIZES:Us.FACEBOOK_IMAGE_SIZES}(t),n=function(e,t,s){return"square"===s&&t.width===t.height?{width:e.squareWidth,height:e.squareHeight}:Ys(t,zs(e,t,s))}(o,r,i);return{mode:i,height:n.height,width:n.width}}async function Ks(e,t,s=!1){try{return{imageProperties:await Vs(e,t,s),status:"loaded"}}catch(e){return{imageProperties:null,status:"errored"}}}Hs.propTypes={imageProps:G().shape({src:G().string.isRequired,alt:G().string.isRequired,aspectRatio:G().number.isRequired}).isRequired,width:G().number.isRequired,height:G().number.isRequired,imageMode:G().string};const Zs=Os().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: ${Ws.colors.$color_white};
`,Xs=Os().div`
	box-sizing: border-box;
	max-width: ${Us.FACEBOOK_IMAGE_SIZES.landscapeWidth}px;
	height: ${Us.FACEBOOK_IMAGE_SIZES.landscapeHeight}px;
	background-color: ${Ws.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 Js extends we.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 Ks(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:Us.FACEBOOK_IMAGE_SIZES.squareHeight+"px",width:Us.FACEBOOK_IMAGE_SIZES.squareWidth+"px"};case"portrait":return{height:Us.FACEBOOK_IMAGE_SIZES.portraitHeight+"px",width:Us.FACEBOOK_IMAGE_SIZES.portraitWidth+"px"};case"landscape":return{height:Us.FACEBOOK_IMAGE_SIZES.landscapeHeight+"px",width:Us.FACEBOOK_IMAGE_SIZES.landscapeWidth+"px"}}}render(){const{imageProperties:e,status:t}=this.state;if("loading"===t||""===this.props.src||"errored"===t)return(0,de.jsx)(Xs,{onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,oe.__)("Select image","wordpress-seo")});const s=this.retrieveContainerDimensions(e.mode);return(0,de.jsx)(Zs,{mode:e.mode,dimensions:s,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,onClick:this.props.onImageClick,children:(0,de.jsx)(Hs,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:Us.FACEBOOK_IMAGE_SIZES.aspectRatio},width:e.width,height:e.height,imageMode:e.mode})})}}Js.propTypes={src:G().string,alt:G().string,onImageLoaded:G().func,onImageClick:G().func,onMouseEnter:G().func,onMouseLeave:G().func},Js.defaultProps={src:"",alt:"",onImageLoaded:o.noop,onImageClick:o.noop,onMouseEnter:o.noop,onMouseLeave:o.noop};const Qs=Js,er=Os().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;
`,tr=Os().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;
	}
`,sr=e=>{switch(e){case"landscape":return"527px";case"square":case"portrait":return"369px";default:return"476px"}},rr=Os().div`
	box-sizing: border-box;
	display: flex;
	flex-direction: ${e=>"landscape"===e.mode?"column":"row"};
	background-color: #f2f3f5;
	max-width: 527px;
`,ir=Os().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 or extends we.Component{constructor(e){super(e),this.state={imageMode:null,maxLineCount:0,descriptionLineCount:0},this.facebookTitleRef=fe().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 i=t-r;"portrait"===s&&(i=5===r?0:4),i!==e&&this.setState({descriptionLineCount:i})}componentDidUpdate(){this.maybeSetMaxLineCount(),this.maybeSetDescriptionLineCount()}render(){const{imageMode:e,maxLineCount:t,descriptionLineCount:s}=this.state;return(0,de.jsxs)(rr,{id:"facebookPreview",mode:e,children:[(0,de.jsx)(Qs,{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,de.jsxs)(ir,{mode:e,children:[(0,de.jsx)(qs,{siteUrl:this.props.siteUrl,mode:e}),(0,de.jsx)(er,{ref:this.facebookTitleRef,onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle,lineCount:t,children:this.props.title}),s>0&&(0,de.jsx)(tr,{maxWidth:sr(e),onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription,lineCount:s,children:this.props.description})]})]})}}or.propTypes={siteUrl:G().string.isRequired,title:G().string.isRequired,description:G().string,imageUrl:G().string,imageFallbackUrl:G().string,alt:G().string,onSelect:G().func,onImageClick:G().func,onMouseHover:G().func},or.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{}};const nr=or,ar=Os().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;
`,lr=e=>(0,de.jsx)(ar,{children:(0,de.jsx)("span",{children:e.siteUrl})});lr.propTypes={siteUrl:G().string.isRequired};const cr=lr,dr=(e,t=!0)=>e?`\n\t\t\tmax-width: ${Us.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: ${Us.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`,pr=Os().div`
	position: relative;
	box-sizing: content-box;
	overflow: hidden;
	background-color: #e1e8ed;
	flex-shrink: 0;
	${e=>dr(e.isLarge)}
`,ur=Os().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=>dr(e.isLarge,!1)}
`,hr=Os()(ur)`
	${e=>e.isLarge&&`height: ${Us.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 mr extends fe().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 Ks(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,de.jsx)(hr,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,oe.__)("Select image","wordpress-seo")}):(0,de.jsx)(pr,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,de.jsx)(Hs,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:Us.TWITTER_IMAGE_SIZES.aspectRatio},width:t.width,height:t.height,imageMode:t.mode})})}}mr.propTypes={isLarge:G().bool.isRequired,src:G().string,alt:G().string,onImageClick:G().func,onMouseEnter:G().func,onMouseLeave:G().func},mr.defaultProps={src:"",alt:"",onMouseEnter:o.noop,onImageClick:o.noop,onMouseLeave:o.noop};const gr=Os().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;
    }
`,yr=e=>(0,de.jsx)(gr,{children:e.children});yr.propTypes={children:G().array.isRequired};const xr=yr,wr=Os().p`
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin: 0;
	color: rgb(15, 20, 25);
	cursor: pointer;
`,fr=Os().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: ${Us.TWITTER_IMAGE_SIZES.landscapeWidth}px ) {
		display: none;
	}
`,vr=Os().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);
	}
`,br=Os()(vr)`
	flex-direction: column;
	max-height: 370px;
`,Sr=Os()(vr)`
	flex-direction: row;
	height: 125px;
`;class jr extends we.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:i,description:o,siteUrl:n}=this.props,a=e?br:Sr;return(0,de.jsxs)(a,{id:"twitterPreview",children:[(0,de.jsx)(mr,{src:t||s,alt:r,isLarge:e,onImageClick:this.props.onImageClick,onMouseEnter:this.onImageEnter,onMouseLeave:this.onLeave}),(0,de.jsxs)(xr,{children:[(0,de.jsx)(cr,{siteUrl:n}),(0,de.jsx)(wr,{onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle,children:i}),(0,de.jsx)(fr,{onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription,children:o})]})]})}}jr.propTypes={siteUrl:G().string.isRequired,title:G().string.isRequired,description:G().string,isLarge:G().bool,imageUrl:G().string,imageFallbackUrl:G().string,alt:G().string,onSelect:G().func,onImageClick:G().func,onMouseHover:G().func},jr.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{},isLarge:!0};const Cr=jr,kr=window.yoast.componentsNew,_r=window.yoast.replacementVariableEditor;class Er extends we.Component{constructor(e){super(e),this.state={activeField:"",hoveredField:""},this.SocialPreview="Social"===e.socialMediumName?nr:Cr,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:i,imageWarnings:o,siteUrl:n,description:a,descriptionInputPlaceholder:l,descriptionPreviewFallback:c,imageUrl:d,imageFallbackUrl:p,alt:u,title:h,titleInputPlaceholder:m,titlePreviewFallback:g,replacementVariables:y,recommendedReplacementVariables:x,applyReplacementVariables:w,onReplacementVariableSearchChange:f,isPremium:v,isLarge:b,socialPreviewLabel:S,idSuffix:j,activeMetaTabId:C}=this.props,k=w({title:h||g,description:a||c});return(0,de.jsxs)(fe().Fragment,{children:[S&&(0,de.jsx)(kr.SimulatedLabel,{children:S}),(0,de.jsx)(this.SocialPreview,{onMouseHover:this.setHoveredField,onSelect:this.setActiveField,onImageClick:s,siteUrl:n,title:k.title,description:k.description,imageUrl:d,imageFallbackUrl:p,alt:u,isLarge:b,activeMetaTabId:C}),(0,de.jsx)(Us.SocialMetadataPreviewForm,{onDescriptionChange:e,socialMediumName:i,title:h,titleInputPlaceholder:m,onRemoveImageClick:r,imageSelected:!!d,imageUrl:d,imageFallbackUrl:p,onTitleChange:t,onSelectImageClick:s,description:a,descriptionInputPlaceholder:l,imageWarnings:o,replacementVariables:y,recommendedReplacementVariables:x,onReplacementVariableSearchChange:f,onMouseHover:this.setHoveredField,hoveredField:this.state.hoveredField,onSelect:this.setActiveField,activeField:this.state.activeField,isPremium:v,setEditorRef:this.setEditorRef,idSuffix:j})]})}}Er.propTypes={title:G().string.isRequired,onTitleChange:G().func.isRequired,description:G().string.isRequired,onDescriptionChange:G().func.isRequired,imageUrl:G().string.isRequired,imageFallbackUrl:G().string.isRequired,onSelectImageClick:G().func.isRequired,onRemoveImageClick:G().func.isRequired,socialMediumName:G().string.isRequired,alt:G().string,isPremium:G().bool,imageWarnings:G().array,isLarge:G().bool,siteUrl:G().string,descriptionInputPlaceholder:G().string,titleInputPlaceholder:G().string,descriptionPreviewFallback:G().string,titlePreviewFallback:G().string,replacementVariables:_r.replacementVariablesShape,recommendedReplacementVariables:_r.recommendedReplacementVariablesShape,applyReplacementVariables:G().func,onReplacementVariableSearchChange:G().func,socialPreviewLabel:G().string,idSuffix:G().string,activeMetaTabId:G().string},Er.defaultProps={imageWarnings:[],recommendedReplacementVariables:[],replacementVariables:[],isPremium:!1,isLarge:!0,siteUrl:"",descriptionInputPlaceholder:"",titleInputPlaceholder:"",descriptionPreviewFallback:"",titlePreviewFallback:"",alt:"",applyReplacementVariables:e=>e,onReplacementVariableSearchChange:null,socialPreviewLabel:"",idSuffix:"",activeMetaTabId:""};const Rr={},Ir=(e,t,{log:s=console.warn}={})=>{Rr[e]||(Rr[e]=!0,s(t))},Lr=(e,t=o.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};Lr({squareWidth:125,squareHeight:125,landscapeWidth:506,landscapeHeight:265,aspectRatio:50.2},(e,t)=>Ir(`@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.`)),Lr({squareWidth:158,squareHeight:158,landscapeWidth:527,landscapeHeight:273,portraitWidth:158,portraitHeight:237,aspectRatio:52.2,largeThreshold:{width:446,height:233}},(e,t)=>Ir(`@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 Tr=({title:e,description:s})=>{const r=(0,t.useSelect)(e=>e(H).getSiteUrl(),[]),i=(0,t.useSelect)(e=>e(H).getFacebookImageUrl(),[]),n=(0,t.useSelect)(e=>e(H).getEditorDataImageFallback(),[]),a=(0,t.useSelect)(e=>e(H).getFacebookAltText(),[]);return(0,de.jsx)("div",{className:"yst-ai-generator-preview-section",children:(0,de.jsx)(nr,{title:e,description:s,siteUrl:r,imageUrl:i,imageFallbackUrl:n,alt:a,onSelect:o.noop,onImageClick:o.noop,onMouseHover:o.noop})})};Tr.propTypes={title:G().string.isRequired,description:G().string.isRequired};const Ar=()=>(0,de.jsxs)("div",{className:"yst-flex yst-flex-col yst-w-[527px] yst-border yst-mx-auto",children:[(0,de.jsx)(i.SkeletonLoader,{className:"yst-h-[273px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,de.jsxs)("div",{className:"yst-w-full yst-p-4 yst-space-y-1",children:[(0,de.jsx)(i.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,de.jsx)(i.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,de.jsx)(i.SkeletonLoader,{className:"yst-h-3 yst-w-full"})]})]}),Mr=()=>(0,de.jsxs)(i.Alert,{variant:"error",children:[(0,de.jsx)("span",{className:"yst-block yst-font-medium",children:Rt}),(0,de.jsx)(It,{})]}),Pr=({children:e,onRetry:t})=>{const{onClose:s}=(0,i.useModalContext)();return(0,de.jsxs)(ne.Fragment,{children:[e,(0,de.jsxs)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end",children:[(0,de.jsx)(i.Button,{variant:"secondary",onClick:s,children:(0,oe.__)("Close","wordpress-seo")}),(0,de.jsx)(i.Button,{variant:"primary",onClick:t,children:(0,oe.__)("Try again","wordpress-seo")})]})]})};Pr.propTypes={children:G().node.isRequired,onRetry:G().func.isRequired};const Nr=({errorCode:e,errorIdentifier:t,invalidSubscriptions:s=[],showActions:r=!1,onRetry:i=o.noop,errorMessage:n=""})=>{switch(e){case 400:switch(t){case"AI_CONTENT_FILTER":return(0,de.jsx)(at,{});case"NOT_ENOUGH_CONTENT":return(0,de.jsx)(Ye,{});case"SITE_UNREACHABLE":return(0,de.jsx)(Mr,{});case"WP_HTTP_REQUEST_ERROR":return r?(0,de.jsx)(Pr,{onRetry:i,children:(0,de.jsx)(dt,{errorMessage:n})}):(0,de.jsx)(dt,{errorMessage:n});default:return r?(0,de.jsx)(Pr,{onRetry:i,children:(0,de.jsx)(De,{})}):(0,de.jsx)(De,{})}case 402:return(0,de.jsx)(tt,{invalidSubscriptions:s});case 408:return r?(0,de.jsx)(Pr,{onRetry:i,children:(0,de.jsx)(it,{})}):(0,de.jsx)(it,{});case 429:return"USAGE_LIMIT_REACHED"===t?(0,de.jsx)(tt,{invalidSubscriptions:s}):(0,de.jsx)(Je,{});case 410:return(0,de.jsx)(ht,{});default:return r?(0,de.jsx)(Pr,{onRetry:i,children:(0,de.jsx)(De,{})}):(0,de.jsx)(De,{})}};Nr.propTypes={errorCode:G().number.isRequired,errorIdentifier:G().string.isRequired,invalidSubscriptions:G().array,showActions:G().bool,onRetry:G().func,errorMessage:G().string};const Or=G().shape({value:G().string.isRequired,label:G().node.isRequired}),$r=({id:e,name:t,suggestion:s,isChecked:r,onChange:i})=>{const o=(0,ne.useCallback)(()=>i(s.value),[s,i]);return(0,de.jsxs)("label",{htmlFor:e,className:Ae()("yst-flex yst-p-4 yst-items-center yst-border first:yst-rounded-t-md last:yst-rounded-b-md",r&&"yst-z-10 yst-border-primary-500"),children:[(0,de.jsx)("input",{type:"radio",id:e,name:t,className:"yst-radio__input",value:s.value,checked:r,onChange:o}),(0,de.jsx)("div",{className:Ae()("yst-label yst-radio__label yst-flex yst-flex-wrap yst-items-center",!r&&"yst-text-slate-600"),children:s.label})]})};$r.propTypes={id:G().string.isRequired,name:G().string.isRequired,suggestion:Or.isRequired,isChecked:G().bool.isRequired,onChange:G().func.isRequired};const Fr=({idSuffix:e,suggestions:t,selected:s,onChange:r})=>(0,de.jsx)("div",{children:(0,de.jsx)(i.RadioGroup,{className:"yst-suggestions-radio-group yst-flex yst-flex-col",id:`yst-ai-suggestions-radio-group__${e}`,children:t.map((t,i)=>(0,de.jsx)($r,{id:`yst-ai-suggestions-radio-${e}__${i}`,name:`ai-suggestion__${e}`,isChecked:t.value===s,onChange:r,suggestion:t},`yst-ai-suggestions-radio-${e}__${i}`))})});Fr.propTypes={idSuffix:G().string.isRequired,suggestions:G().arrayOf(Or).isRequired,selected:G().string.isRequired,onChange:G().func.isRequired};const qr=[["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-9/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-7/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-10/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-11/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-8/12"]],Ur=({suggestionClassNames:e=qr})=>(0,de.jsx)("div",{className:"yst-flex yst-flex-col yst--space-y-[1px]",children:e.map((e,t)=>(0,de.jsxs)("div",{className:"yst-flex yst-p-4 yst-gap-x-3 yst-items-center yst-border first:yst-rounded-t-md last:yst-rounded-b-md",children:[(0,de.jsx)("input",{type:"radio",disabled:!0,className:"yst-my-0.5"}),(0,de.jsx)("div",{className:"yst-flex yst-flex-col yst-w-full",children:e.map((e,s)=>(0,de.jsx)(i.SkeletonLoader,{className:e},`yst-ai-suggestion-radio-skeleton-${t}__${s}`))})]},`yst-ai-suggestion-radio-skeleton__${t}`))});Ur.propTypes={suggestionClassNames:G().arrayOf(G().arrayOf(G().string))};const Wr="ai_generator_tip_notification",Br=()=>{const e=(0,t.useSelect)(e=>e(H).isAlertDismissed(Wr),[]),s=(0,t.useSelect)(e=>e(H).getEditorDataContent(),[]),r=(0,t.useSelect)(e=>e(H).getIsWooProductEntity(),[]),[o,,,n]=(0,i.useToggleState)(!1),{editType:a,contentType:l}=Qt(),{dismissAlert:c}=(0,t.useDispatch)(H),d=(0,ne.useCallback)(()=>{c(Wr)},[c]),p=(0,ne.useMemo)(()=>a===Z?(0,oe.__)("%1$sTip%2$s: Improve the accuracy of your generated AI descriptions by writing more content in your page.","wordpress-seo"):(0,oe.__)("%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. */,[a]),u=(0,ne.useMemo)(()=>((e,t)=>e||t===J?150:300)(r,l),[l,r]);return e||o||s.length>u?null:(0,de.jsxs)(i.Notifications.Notification,{id:"ai-generator-content-tip",variant:"info",dismissScreenReaderLabel:(0,oe.__)("Dismiss","wordpress-seo"),children:[ae((0,oe.sprintf)(p,"<span>","</span>"),{span:(0,de.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})}),(0,de.jsxs)("div",{className:"yst-flex yst-mt-3 yst--ms-3 yst-gap-1",children:[(0,de.jsx)(i.Button,{type:"button",variant:"tertiary",onClick:d,children:(0,oe.__)("Don’t show again","wordpress-seo")}),(0,de.jsx)(i.Button,{type:"button",variant:"tertiary",className:"yst-text-slate-800",onClick:n,children:(0,oe.__)("Dismiss","wordpress-seo")})]})]})},Gr=({title:e,description:t,showPreviewSkeleton:s})=>(0,de.jsxs)("div",{children:[(0,de.jsx)("div",{className:"yst-flex yst-mb-6",children:(0,de.jsx)(i.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:(0,oe.__)("X preview","wordpress-seo")})}),s?(0,de.jsx)(Hr,{}):(0,de.jsx)(Dr,{title:e,description:t})]});Gr.propTypes={title:G().string.isRequired,description:G().string.isRequired,showPreviewSkeleton:G().bool.isRequired};const Dr=({title:e,description:s})=>{const r=(0,t.useSelect)(e=>e(H).getSiteUrl(),[]),i=(0,t.useSelect)(e=>e(H).getTwitterImageUrl(),[]),n=(0,t.useSelect)(e=>e(H).getFacebookImageUrl(),[]),a=(0,t.useSelect)(e=>e(H).getEditorDataImageFallback(),[]),l=(0,t.useSelect)(e=>e(H).getTwitterImageType(),[]),c=(0,t.useSelect)(e=>e(H).getTwitterAltText(),[]);return(0,de.jsx)("div",{className:"yst-ai-generator-preview-section",children:(0,de.jsx)(Cr,{title:e,description:s,siteUrl:r,imageUrl:i,imageFallbackUrl:n||a,isLarge:"summary"!==l,alt:c,onSelect:o.noop,onImageClick:o.noop,onMouseHover:o.noop})})};Dr.propTypes={title:G().string.isRequired,description:G().string.isRequired};const Hr=()=>(0,de.jsxs)("div",{className:"yst-flex yst-flex-col yst-max-h-[370px] yst-w-[507px] yst-border yst-rounded-t-[14px] yst-overflow-hidden yst-mx-auto",children:[(0,de.jsx)(i.SkeletonLoader,{className:"yst-h-[265px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,de.jsxs)("div",{className:"yst-w-full yst-p-4 yst-space-y-1",children:[(0,de.jsx)(i.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,de.jsx)(i.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,de.jsx)(i.SkeletonLoader,{className:"yst-h-3 yst-w-full"})]})]}),zr="yst-mt-1 yst-mb-3",Yr="yst-flex yst-justify-end yst--me-8 yst-gap-3 yst--ms-2",Vr=({onClose:e})=>(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)("p",{className:zr,children:(0,oe.__)("As long as this is a beta feature, you get unlimited sparks.","wordpress-seo")}),(0,de.jsx)("div",{className:Yr,children:(0,de.jsx)(i.Button,{type:"button",variant:"primary",size:"small",onClick:e,children:(0,oe.__)("Got it!","wordpress-seo")})})]}),Kr=({onClose:e,upsellLink:t,isWooProductEntity:s=!1,ctbId:r="f6a84663-465f-4cb5-8ba5-f7a6d72224b2"})=>{const o=(0,i.useSvgAria)();return(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)("p",{className:zr,children:(0,oe.sprintf)(/* translators: %s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ /* translators: %s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */
(0,oe.__)("Keep the momentum going, unlock unlimited sparks with %s!","wordpress-seo"),s?"Yoast WooCommerce SEO":"Yoast SEO Premium")}),(0,de.jsxs)("div",{className:Yr,children:[(0,de.jsx)(i.Button,{type:"button",variant:"tertiary",size:"small",onClick:e,children:(0,oe.__)("Close","wordpress-seo")}),(0,de.jsxs)(i.Button,{as:"a",size:"small",variant:"upsell",href:t,target:"_blank",rel:"noopener noreferrer","data-action":"load-nfd-ctb","data-ctb-id":r,children:[(0,de.jsx)(ue(),{className:"yst-w-4 yst-h-4 yst--ms-1 yst-me-2 yst-shrink-0",...o}),(0,oe.sprintf)(/* translators: %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ /* translators: %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */
(0,oe.__)("Unlock with %1$s","wordpress-seo"),s?"Yoast WooCommerce SEO":"Yoast SEO Premium"),(0,de.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,oe.__)("(Opens in a new browser tab)","wordpress-seo")})]})]})]})},Zr=({className:e=""})=>{const{isUsageCountLimitReached:s,usageCount:r,usageCountLimit:o,premiumUpsellLink:n,wooUpsellLink:a,isWooProductEntity:l,hasValidPremiumSubscription:c,hasValidWooSubscription:d}=(0,t.useSelect)(e=>{const t=e(D),s=e(H);return{isUsageCountLimitReached:t.isUsageCountLimitReached(),usageCount:t.selectUsageCount(),usageCountLimit:t.selectUsageCountLimit(),premiumUpsellLink:s.selectLink("https://yoa.st/ai-toast-out-of-free-sparks"),wooUpsellLink:s.selectLink("https://yoa.st/ai-toast-out-of-free-sparks-woo"),isWooProductEntity:s.getIsWooProductEntity(),hasValidPremiumSubscription:t.selectPremiumSubscription(),hasValidWooSubscription:t.selectWooCommerceSubscription()}},[]),p=(0,ne.useMemo)(()=>c&&!l||l&&d&&c,[c,l,d]),[u,,h,,m]=(0,i.useToggleState)(r===o),g=Math.max(0,o-r);(0,ne.useEffect)(()=>{h(p&&r===o||!p&&g<=5)},[r,o,p,s]);const y=(0,ne.useMemo)(()=>l?a:n,[l,a,n]),x=(0,ne.useMemo)(()=>l&&!d,[l,d]);return u&&(0,de.jsx)(i.Notifications.Notification,{id:"ai-sparks-limit",className:e,variant:"info",dismissScreenReaderLabel:(0,oe.__)("Close","wordpress-seo"),title:p?(0,oe.sprintf)(/* translators: %s is the number of the sparks. */ /* translators: %s is the number of the sparks. */
(0,oe._n)("You've used %s spark this month.","You've used %s sparks this month.",r,"wordpress-seo"),r):g<=5&&!s?(0,oe.sprintf)(/* translators: %s is the number of the sparks. */ /* translators: %s is the number of the sparks. */
(0,oe._n)("%s free spark left!","%s free sparks left!",g,"wordpress-seo"),g):(0,oe.__)("You're out of free sparks!","wordpress-seo"),size:p?"default":"large",children:p?(0,de.jsx)(Vr,{onClose:m}):(0,de.jsx)(Kr,{onClose:m,upsellLink:y,isWooUpsell:x})})};G().number.isRequired,G().string,G().string,G().object.isRequired,G().bool;const Xr=()=>{const{setPromptContent:e}=(0,t.dispatch)(D);return()=>{(e=>{const s=(0,t.select)(H).getIsProduct(),r=(0,t.select)(H).getIsTerm(),i=(0,t.select)(H).getIsWooCommerceActive(),n=s&&i||r?150:300,a=(0,o.get)(window,"YoastSEO.analysis.worker.runResearch",o.noop),l=(0,o.get)(window,"YoastSEO.analysis.collectData",!1);a("getParagraphs",l?Ft.Paper.parse(l()):null).then(t=>{let s="";if(t.result){const e=t.result;if(e){let t=0;e.forEach(e=>{e.sentences.forEach(e=>{if(t+=e.tokens.length,t>n)return s;s+=e.text.replace(/[\n\r]+/g," ")}),s+=" ",t+=1})}}e(s.trimEnd()||".")})})(e)}},Jr=()=>{Xr(),(0,t.subscribe)((0,o.debounce)((()=>{const{getEditorDataContent:e}=(0,t.select)(H),s=Xr();return setTimeout(s,1500),((e,t)=>{let s=e();return()=>{const r=e();(0,o.isEqual)(r,s)||(s=r,t((0,o.clone)(r)))}})(e,s)})(),1500,{maxWait:3e3}))};let Qr=!1;const ei=()=>{Qr||(Qr=!0)},ti=(e,t)=>Qr?(Yt(t)&&e.push((0,oe.__)("Please enter a valid focus keyphrase.","wordpress-seo")),e):e,si="appliedSuggestions",ri=(0,n.createSlice)({name:si,initialState:{},reducers:{addAppliedSuggestion:(e,{payload:{editType:t,previewType:s,suggestion:r}})=>{e[s]={...e[s],[t]:r}}}}),ii=ri.getInitialState,oi={selectAppliedSuggestions:e=>(0,o.get)(e,si,{})};oi.selectAppliedSuggestionFor=(0,n.createSelector)([oi.selectAppliedSuggestions,(e,t)=>t],(e,{editType:t,previewType:s})=>(0,o.get)(e,[s,t],""));const ni=ri.actions,ai=ri.reducer,li="productSubscriptions",ci=(0,n.createSlice)({name:li,initialState:{premiumSubscription:!1,wooCommerceSubscription:!1},reducers:{}}),di=ci.getInitialState,pi={selectProductSubscriptions:e=>(0,o.get)(e,li,di()),selectPremiumSubscription:e=>(0,o.get)(e,`${li}.premiumSubscription`),selectWooCommerceSubscription:e=>(0,o.get)(e,`${li}.wooCommerceSubscription`)},ui=ci.actions,hi=ci.reducer,mi="promptContent",gi=(0,n.createSlice)({name:mi,initialState:{content:"",initialized:!1},reducers:{setPromptContent:(e,{payload:t})=>({content:t,initialized:!0})}}),yi=gi.getInitialState,xi={selectPromptContent:e=>(0,o.get)(e,`${mi}.content`,""),selectPromptContentInitialized:e=>(0,o.get)(e,`${mi}.initialized`,!1)},wi=gi.actions,fi=gi.reducer,vi="endpoints",bi=(0,n.createSlice)({name:vi,initialState:{getSuggestions:"",bustSubscriptionCache:""},reducers:{}}),Si=bi.getInitialState,ji={selectGetSuggestionsEndpoint:e=>(0,o.get)(e,[vi,"getSuggestions"],bi.getInitialState().getSuggestions),selectBustSubscriptionCacheEndpoint:e=>(0,o.get)(e,[vi,"bustSubscriptionCache"],bi.getInitialState().bustSubscriptionCache)},Ci={...bi.actions},ki=bi.reducer,_i="freeSparks",Ei="activateFreeSparks",Ri=(0,n.createSlice)({name:_i,initialState:{isFreeSparksActive:!1,endpoint:""},extraReducers:e=>{e.addCase(`${Ei}/${I}`,e=>{e.isFreeSparksActive=!0})}}),Ii=Ri.getInitialState,Li={selectFreeSparksActiveEndpoint:e=>(0,o.get)(e,[_i,"endpoint"],Ri.getInitialState().endpoint),selectIsFreeSparksActive:e=>(0,o.get)(e,[_i,"isFreeSparksActive"],Ri.getInitialState().isFreeSparksActive)},Ti={...Ri.actions,activateFreeSparks:function*({endpoint:e}){try{yield{type:Ei,payload:e}}catch(e){console.error("Error starting free sparks:",e)}return{type:`${Ei}/${I}`}}},Ai={[Ei]:async({payload:e})=>p()({method:"POST",path:e})},Mi=Ri.reducer,Pi="myyoastConnection",Ni=(0,n.createSlice)({name:Pi,initialState:{isAvailable:!1,canConnect:!1,connectUrl:null,learnMoreUrl:""},reducers:{}}),Oi=Ni.getInitialState,$i={selectMyyoastConnection:e=>(0,o.get)(e,Pi,Oi())},Fi=Ni.actions,qi=Ni.reducer,Ui=window.wp.domReady,Wi=(s,{fieldId:r,type:o})=>{const n=(0,t.select)(H).getPostType(),a=function(e){return e.startsWith("yoast-google-preview")?z:e.startsWith("social")?Y:e.startsWith("x-")?V:void 0}(r);if(!a)return s;const l={isRtl:(0,t.select)(H).getPreference("isRtl")},c={editType:o,previewType:a,postType:n,contentType:(0,t.select)(H).getIsTerm()?"term":"post"};return s.push((0,de.jsx)(e.Fill,{name:`yoast.replacementVariableEditor.additionalButtons.${r}`,children:(0,de.jsx)(i.Root,{context:l,children:(0,de.jsx)(Jt,{value:c,children:(0,de.jsx)(Rs,{onUseAi:ei})})})})),s};s.n(Ui)()(()=>{var e;null!==(e=window.wpseoScriptData)&&void 0!==e&&e.postType&&(()=>{const e=(0,o.get)(window,"wpseoAiGenerator.myyoastConnection",null);((e={})=>{(0,t.register)((e=>(0,t.createReduxStore)(D,{actions:{...x,...ni,...ui,...wi,...ms,...Ti,...Ci,...Fi},selectors:{...y,...oi,...pi,...xi,...hs,...Li,...ji,...$i},initialState:(0,o.merge)({},{[u]:g(),[si]:ii(),[li]:di(),[mi]:yi(),[ns]:us(),[_i]:Ii(),[vi]:Si(),[Pi]:Oi()},e),reducer:(0,t.combineReducers)({[u]:f,[si]:ai,[li]:hi,[mi]:fi,[ns]:ys,[_i]:Mi,[vi]:ki,[Pi]:qi}),controls:{...w,...gs,...Ai}}))(e))})({[u]:{hasConsent:"1"===(0,o.get)(window,"wpseoAiGenerator.hasConsent",!1),endpoint:(0,o.get)(window,"wpseoAiGenerator.endpoints.consent","")},[ns]:{endpoint:(0,o.get)(window,"wpseoAiGenerator.endpoints.getUsage","")},[li]:(0,o.get)(window,"wpseoAiGenerator.productSubscriptions",{}),[_i]:{isFreeSparksActive:"1"===(0,o.get)(window,"wpseoAiGenerator.isFreeSparks",!1),endpoint:(0,o.get)(window,"wpseoAiGenerator.endpoints.freeSparks","")},[vi]:{getSuggestions:(0,o.get)(window,"wpseoAiGenerator.endpoints.getSuggestions",""),bustSubscriptionCache:(0,o.get)(window,"wpseoAiGenerator.endpoints.bustSubscriptionCache","")},[Pi]:{isAvailable:Boolean(e)&&(0,o.get)(e,"isProvisioned",!1),canConnect:(0,o.get)(e,"canConnect",!1),connectUrl:(0,o.get)(e,"connectUrl",null),learnMoreUrl:(0,o.get)(e,"learnMoreUrl","")}}),window.jQuery(window).on("YoastSEO:ready",()=>{Jr()}),(0,r.addFilter)("yoast.replacementVariableEditor.additionalButtons","yoast/yoast-seo/AiGenerator",Wi),(0,r.addFilter)("yoast.focusKeyphrase.errors","yoast/yoast-seo/AiGenerator",ti),(0,r.addAction)("yoast.elementor.loaded","yoast/yoast-seo/AiGenerator",Jr)})()})})()})();

Home - Capital GMC Buick Regina

No data

Welcome to Capital GMC BUICK – REGINA

Thank you for choosing Capital GMC Buick | Regina, your premier certified Buick and GMC dealership proudly serving drivers in Regina and the surrounding communities. Whether you’re searching for a brand-new Buick or GMC vehicle or a meticulously inspected pre-owned model, we have a diverse selection to match your needs and lifestyle.

Beyond our impressive inventory, we offer a seamless and stress-free financing experience through our well-connected finance centre, where our team of experts is dedicated to securing the best loan or lease options for you, quickly, transparently, and hassle-free.

But our commitment to you doesn’t stop at the sale. Our state-of-the-art service centre is staffed with skilled Buick and GMC technicians who use the latest equipment and genuine OEM parts to keep your vehicle running at its best. From routine maintenance to complex repairs, we’ve got you covered.

Experience top-tier customer service, quality vehicles, and expert care, all in one place. Visit Capital GMC Buick | Regina today or call us at 306-205-8072 with any questions. We’re here to help!

Ask a Question