1 line
78 KiB
JavaScript
1 line
78 KiB
JavaScript
!function(){var t={6942:function(t,e){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var t="",e=0;e<arguments.length;e++){var r=arguments[e];r&&(t=a(t,i(r)))}return t}function i(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return o.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var r in t)n.call(t,r)&&t[r]&&(e=a(e,r));return e}function a(t,e){return e?t?t+" "+e:t+e:t}t.exports?(o.default=o,t.exports=o):void 0===(r=function(){return o}.apply(e,[]))||(t.exports=r)}()}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.dn=function(t){(Object.getOwnPropertyDescriptor(t,"name")||{}).writable||Object.defineProperty(t,"name",{value:"default",configurable:!0})},function(){"use strict";var t={};r.r(t),r.d(t,{deleteSchema:function(){return fe},lockModifiedDate:function(){return E},refreshResults:function(){return Vt},resetDirtyMetadata:function(){return I},resetRedirection:function(){return V},resetStore:function(){return j},saveSchema:function(){return pe},saveTemplate:function(){return de},schemaUpdated:function(){return oe},setEditingSchemaId:function(){return ie},setEditorTab:function(){return ae},setTemplateTab:function(){return ue},setVersion:function(){return Wt},toggleFrontendScore:function(){return _},toggleIsDiviPageSettingsBarActive:function(){return qt},toggleIsDiviRankMathModalActive:function(){return $t},toggleLoaded:function(){return Bt},toggleSchemaEditor:function(){return re},toggleSchemaTemplates:function(){return ne},toggleSnippetEditor:function(){return yt},updateAIScore:function(){return me},updateAdvancedRobots:function(){return T},updateAnalysisScore:function(){return S},updateAppData:function(){return b},updateAppUi:function(){return v},updateBreadcrumbTitle:function(){return D},updateCanonicalUrl:function(){return P},updateDescription:function(){return K},updateEditSchema:function(){return le},updateEditSchemas:function(){return ce},updateFacebookDescription:function(){return M},updateFacebookHasOverlay:function(){return U},updateFacebookImage:function(){return C},updateFacebookImageID:function(){return R},updateFacebookImageOverlay:function(){return N},updateFacebookTitle:function(){return A},updateFeaturedImage:function(){return H},updateHasRedirect:function(){return W},updateHighlightedParagraphs:function(){return Jt},updateKeywords:function(){return w},updatePermalink:function(){return x},updatePillarContent:function(){return k},updatePostID:function(){return F},updatePrimaryTermID:function(){return B},updateRedirection:function(){return z},updateRedirectionItem:function(){return G},updateRobots:function(){return O},updateSchemas:function(){return se},updateSelectedKeyword:function(){return zt},updateSerpDescription:function(){return ht},updateSerpSlug:function(){return mt},updateSerpTitle:function(){return dt},updateSnippetPreviewType:function(){return gt},updateSocialTab:function(){return Gt},updateTitle:function(){return L},updateTwitterAppCountry:function(){return Ht},updateTwitterAppDescription:function(){return At},updateTwitterAppGoogleplayID:function(){return xt},updateTwitterAppGoogleplayName:function(){return Lt},updateTwitterAppGoogleplayUrl:function(){return Kt},updateTwitterAppIpadID:function(){return Ut},updateTwitterAppIpadName:function(){return Nt},updateTwitterAppIpadUrl:function(){return Ft},updateTwitterAppIphoneID:function(){return Mt},updateTwitterAppIphoneName:function(){return Ct},updateTwitterAppIphoneUrl:function(){return Rt},updateTwitterAuthor:function(){return _t},updateTwitterCardType:function(){return vt},updateTwitterDescription:function(){return kt},updateTwitterHasOverlay:function(){return Tt},updateTwitterImage:function(){return Pt},updateTwitterImageID:function(){return St},updateTwitterImageOverlay:function(){return Ot},updateTwitterPlayerSize:function(){return Et},updateTwitterPlayerStreamCtype:function(){return jt},updateTwitterPlayerStreamUrl:function(){return It},updateTwitterPlayerUrl:function(){return Dt},updateTwitterTitle:function(){return wt},updateTwitterUseFacebook:function(){return bt}});var e={};r.r(e),r.d(e,{appData:function(){return we},appUi:function(){return Oe}});var n={};r.r(n),r.d(n,{getAdvancedRobots:function(){return Ce},getAnalysisScore:function(){return Ie},getAppData:function(){return De},getBreadcrumbTitle:function(){return Ue},getCanonicalUrl:function(){return Re},getDescription:function(){return nr},getDirtyMetadata:function(){return Ee},getEditSchemas:function(){return _r},getEditingSchema:function(){return Sr},getEditorTab:function(){return Tr},getFacebookAuthor:function(){return Je},getFacebookDescription:function(){return $e},getFacebookHasOverlay:function(){return Ye},getFacebookImage:function(){return Ze},getFacebookImageID:function(){return Qe},getFacebookImageOverlay:function(){return Xe},getFacebookTitle:function(){return qe},getFeaturedImage:function(){return or},getFeaturedImageHtml:function(){return ir},getHighlightedParagraphs:function(){return We},getKeywords:function(){return je},getPermalink:function(){return rr},getPillarContent:function(){return Ae},getPostID:function(){return tr},getPreviewSchema:function(){return Pr},getPrimaryTermID:function(){return ar},getRedirectionID:function(){return ur},getRedirectionItem:function(){return lr},getRedirectionType:function(){return cr},getRedirectionUrl:function(){return sr},getRichSnippets:function(){return Ne},getRobots:function(){return Me},getSchemas:function(){return kr},getSelectedKeyword:function(){return Ke},getSerpDescription:function(){return hr},getSerpSlug:function(){return mr},getSerpTitle:function(){return dr},getShowScoreFrontend:function(){return Fe},getSnippetPreviewType:function(){return gr},getSocialTab:function(){return He},getTemplateTab:function(){return Or},getTitle:function(){return er},getTwitterAppCountry:function(){return Wr},getTwitterAppDescription:function(){return Nr},getTwitterAppGoogleplayID:function(){return zr},getTwitterAppGoogleplayName:function(){return Gr},getTwitterAppGoogleplayUrl:function(){return Vr},getTwitterAppIpadID:function(){return Kr},getTwitterAppIpadName:function(){return Hr},getTwitterAppIpadUrl:function(){return Br},getTwitterAppIphoneID:function(){return Fr},getTwitterAppIphoneName:function(){return xr},getTwitterAppIphoneUrl:function(){return Lr},getTwitterAuthor:function(){return Ar},getTwitterCardType:function(){return Er},getTwitterDescription:function(){return jr},getTwitterHasOverlay:function(){return Rr},getTwitterImage:function(){return Cr},getTwitterImageID:function(){return Mr},getTwitterImageOverlay:function(){return Ur},getTwitterPlayerSize:function(){return $r},getTwitterPlayerStream:function(){return Jr},getTwitterPlayerStreamCtype:function(){return Qr},getTwitterPlayerUrl:function(){return qr},getTwitterTitle:function(){return Ir},getTwitterUseFacebook:function(){return Dr},hasRedirect:function(){return pr},hasSchemaUpdated:function(){return wr},isDiviPageSettingsBarActive:function(){return Ge},isDiviRankMathModalActive:function(){return Ve},isLoaded:function(){return Le},isModifiedDateLocked:function(){return xe},isPro:function(){return ze},isRefreshing:function(){return Be},isSchemaEditorOpen:function(){return br},isSchemaTemplatesOpen:function(){return vr},isSnippetEditorOpen:function(){return yr}});const o=jQuery;var i=r.n(o);const a=lodash,u=wp.i18n,c=wp.data,s=wp.element,l=wp.plugins,p=wp.hooks,f=wp.editor;function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function m(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,h(n.key),n)}}function h(t){var e=function(t,e){if("object"!=d(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==d(e)?e:e+""}var y=function(){return function(t,e,r){return e&&m(t.prototype,e),r&&m(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){(e=h(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(this,"map",null)},[{key:"swap",value:function(t,e){var r=this;if(!(t=t||""))return"";var n=new RegExp(/%(([a-z0-9_-]+)\(([^)]*)\)|[^\s]+)%/,"giu");return t.replace(" %page%","").replace("%sep% %sep%","%sep%").replace(n,function(t){return r.replace(e,t)}).trim()}},{key:"replace",value:function(t,e){var r=e.toLowerCase().slice(1,-1);if(["term_description","user_description"].includes(r)){var n="term_description"===r?"#rank_math_description_editor":"#description";return"undefined"!=typeof tinymce&&void 0!==tinymce.editors.rank_math_description_editor?tinymce.editors.rank_math_description_editor.getContent():i()(n).val()}return r.includes("customfield(")?(r=r.replace("customfield(","").replace(")",""))in rankMath.customFields?rankMath.customFields[r]:"":(t=t||this.getMap(),(r="seo_description"===(r="seo_title"===(r=r.includes("(")?r.split("(")[0]:r)?"title":r)?"excerpt":r)in t?t[r]:"")}},{key:"getMap",value:function(){var t=this;return null!==this.map||(this.map={},i().each(rankMath.variables,function(e,r){e=e.toLowerCase().replace(/%+/g,"").split("(")[0],t.map[e]=r.example})),this.map}},{key:"setVariable",value:function(t,e){null!==this.map?this.map[t]=e:void 0!==rankMath.variables[t]&&(rankMath.variables[t].example=e)}}])}(),g=new y;function b(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return e=(0,p.applyFilters)("rank_math_sanitize_data",e,t,r),null!==n&&(n=(0,p.applyFilters)("rank_math_sanitize_meta_value",n,t,r)),n=null===n?e:n,(0,p.doAction)("rank_math_data_changed",t,e,r),{type:"RANK_MATH_APP_DATA",key:t,value:e,metaKey:r,metaValue:n}}function v(t,e){return(0,p.doAction)("rank_math_update_app_ui",t,e),{type:"RANK_MATH_APP_UI",key:t,value:e}}function w(t){return g.setVariable("focuskw",t.split(",")[0]),rankMathEditor.refresh("keyword"),b("keywords",t,"rank_math_focus_keyword")}function k(t){return b("pillarContent",t,"rank_math_pillar_content",!0===t?"on":"off")}function _(t){return b("showScoreFrontend",t,"rank_math_dont_show_seo_score",!0===t?"off":"on")}function S(t){return b("score",t,"rank_math_seo_score")}function P(t){return b("canonicalUrl",t,"rank_math_canonical_url")}function T(t){return b("advancedRobots",t,"rank_math_advanced_robots")}function O(t){return b("robots",t,"rank_math_robots",Object.keys(t))}function D(t){return b("breadcrumbTitle",t,"rank_math_breadcrumb_title")}function E(t){return b("lockModifiedDate",t,"rank_math_lock_modified_date")}function I(){return b("dirtyMetadata",{})}function j(t){return{type:"RESET_STORE",value:t}}function A(t){return b("facebookTitle",t,"rank_math_facebook_title")}function M(t){return b("facebookDescription",t,"rank_math_facebook_description")}function C(t){return b("facebookImage",t,"rank_math_facebook_image")}function R(t){return b("facebookImageID",t,"rank_math_facebook_image_id")}function U(t){return b("facebookHasOverlay",t,"rank_math_facebook_enable_image_overlay",!0===t?"on":"off")}function N(t){return b("facebookImageOverlay",t,"rank_math_facebook_image_overlay")}function F(t){return rankMath.objectID=t,b("postID",t)}function x(t){return b("permalink",t,"permalink")}function L(t){return b("title",t,"rank_math_title")}function K(t){return b("description",t,"rank_math_description")}function H(t){return b("featuredImage",t)}function B(t,e){return b("primaryTerm",parseInt(t),"rank_math_primary_"+e)}function z(t,e){return b(t,e)}function G(t){return v("redirectionItem",t)}function V(){return v("redirectionItem",{})}function W(t){return v("hasRedirect",t)}const q=function(t){return t.replace(/<\/?[a-z][^>]*?>/gi,"")};r.dn(q);const $=function(t){return t.replace(/<style[^>]*>([\S\s]*?)<\/style>/gim,"")};r.dn($);const J=function(t){return t.replace(/ | /gi," ").replace(/\s{2,}/g," ").replace(/\s\./g,".").replace(/^\s+|\s+$/g,"")};r.dn(J);const Q=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,e)};r.dn(Q);const Z=function(t){return t.replace(/[‘’‛`]/g,"'").replace(/[“”〝〞〟‟„]/g,'"')};r.dn(Z);const Y=function(t){return t.replace(/<!--[\s\S]*?-->/g,"")};r.dn(Y);const X=function(t){return t.replace(/&\S+?;/g,"")};function tt(t){return(0,a.isUndefined)(t)||!t?"":(0,a.flow)([$,Q,q,Y,X,J,Z])(t)}r.dn(X);const et=wp.autop;var rt="[^<>&/\\[\\]\0- =]+?",nt=new RegExp("\\["+rt+"( [^\\]]+?)?\\]","g"),ot=new RegExp("\\[/"+rt+"\\]","g");const it=function(t){return t.replace(nt,"").replace(ot,"")};r.dn(it);const at=function(t,e){var r=function(t,e){for(var r,n=/<p(?:[^>]+)?>(.*?)<\/p>/gi,o=[];null!==(r=n.exec(t));)o.push(r);return(0,a.map)(o,function(t){return e?tt(t[1]):t[1]})}(t=(0,a.flow)([it,Y,et.autop])(t),e=e||!1);return 0<r.length?r:[e?tt(t):t]};r.dn(at),r.dn(ct);var ut=document.createElement("div");function ct(t){return t&&"string"==typeof t&&(t=t.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"").replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),ut.innerHTML=t,t=ut.textContent,ut.textContent=""),t}r.dn(ft);var st=function(t,e){return t=(t=tt(t)).replace(/\r?\n|\r/g," "),e?(0,a.truncate)(t,{length:e,separator:" "}):t},lt=function(t){if((0,a.isEmpty)(t))return"";t=Q(t),t=$(t),t=(0,a.unescape)(t).replace(/\[caption[^\]]*\](.*)\[\/caption\]/g,"");var e=(0,a.filter)(at(t,!0),function(t){return""!==t.trim()});if(!e.length)return"";var r=rankMathEditor.getPrimaryKeyword();if(""!==r){var n=(0,a.filter)(e,function(t){return(0,a.includes)(t.toLowerCase(),r.toLowerCase())});if(0<n.length)return st(n[0],160)}return st(e[0],160)},pt=function(t){return!(0,a.isUndefined)(t)&&!(0,a.isEmpty)(t)&&tt(t)};function ft(t){var e=rankMathEditor.assessor.dataCollector.getData(),r=e.excerpt,n=lt(e.content),o=(0,a.isUndefined)(r)||(0,a.isEmpty)(r)?n:(0,a.unescape)(r);if(g.setVariable("excerpt",o),g.setVariable("seo_description",o),""!==(t=ct((0,p.applyFilters)("rankMath/description",t))))return tt(t);var i=(0,a.unescape)(rankMath.assessor.serpData.descriptionTemplate);return"term"===rankMath.objectType?pt(i)||pt(r)||n:pt(r)||pt(i)||n}function dt(t){return t=g.swap(""!==t?t:rankMath.assessor.serpData.titleTemplate),rankMathEditor.refresh("title"),v("serpTitle",ct(t))}function mt(t){return t=""!==t?t:rankMathEditor.assessor.dataCollector.getSlug(),rankMathEditor.refresh("permalink"),v("serpSlug",t)}function ht(t){return t=g.swap(ft(t)),rankMathEditor.refresh("description"),v("serpDescription",t)}function yt(t){return v("isSnippetEditorOpen",t)}function gt(t){return v("snippetPreviewType",t)}function bt(t){return b("twitterUseFacebook",t,"rank_math_twitter_use_facebook",!0===t?"on":"off")}function vt(t){return b("twitterCardType",t,"rank_math_twitter_card_type")}function wt(t){return b("twitterTitle",t,"rank_math_twitter_title")}function kt(t){return b("twitterDescription",t,"rank_math_twitter_description")}function _t(t){return b("twitterAuthor",t,"rank_math_twitter_author")}function St(t){return b("twitterImageID",t,"rank_math_twitter_image_id")}function Pt(t){return b("twitterImage",t,"rank_math_twitter_image")}function Tt(t){return b("twitterHasOverlay",t,"rank_math_twitter_enable_image_overlay",!0===t?"on":"off")}function Ot(t){return b("twitterImageOverlay",t,"rank_math_twitter_image_overlay")}function Dt(t){return b("twitterPlayerUrl",t,"rank_math_twitter_player_url")}function Et(t){return b("twitterPlayerSize",t,"rank_math_twitter_player_size")}function It(t){return b("twitterPlayerStream",t,"rank_math_twitter_player_stream")}function jt(t){return b("twitterPlayerStreamCtype",t,"rank_math_twitter_player_stream_ctype")}function At(t){return b("twitterAppDescription",t,"rank_math_twitter_app_description")}function Mt(t){return b("twitterAppIphoneID",t,"rank_math_twitter_app_iphone_id")}function Ct(t){return b("twitterAppIphoneName",t,"rank_math_twitter_app_iphone_name")}function Rt(t){return b("twitterAppIphoneUrl",t,"rank_math_twitter_app_iphone_url")}function Ut(t){return b("twitterAppIpadID",t,"rank_math_twitter_app_ipad_id")}function Nt(t){return b("twitterAppIpadName",t,"rank_math_twitter_app_ipad_name")}function Ft(t){return b("twitterAppIpadUrl",t,"rank_math_twitter_app_ipad_url")}function xt(t){return b("twitterAppGoogleplayID",t,"rank_math_twitter_app_googleplay_id")}function Lt(t){return b("twitterAppGoogleplayName",t,"rank_math_twitter_app_googleplay_name")}function Kt(t){return b("twitterAppGoogleplayUrl",t,"rank_math_twitter_app_googleplay_url")}function Ht(t){return b("twitterAppCountry",t,"rank_math_twitter_app_country")}function Bt(t){return v("isLoaded",t)}function zt(t){return v("selectedKeyword",t)}function Gt(t){return v("socialTab",t)}function Vt(){return v("refreshResults",Date.now())}function Wt(){return v("isPro",!0)}function qt(t){return v("isDiviPageSettingsBarActive",t)}function $t(t){return v("isDiviRankMathModalActive",t)}function Jt(t){return v("highlightedParagraphs",t)}const Qt=wp.apiFetch;var Zt=r.n(Qt);function Yt(t){return Yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yt(t)}function Xt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function te(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Xt(Object(r),!0).forEach(function(e){ee(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function ee(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Yt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Yt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Yt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function re(t){return v("isSchemaEditorOpen",t)}function ne(t){return v("isSchemaTemplatesOpen",t)}function oe(t){return v("schemaUpdated",t)}function ie(t){return v("editingSchemaId",t)}function ae(t){return v("editorTab",t)}function ue(t){return v("templateTab",t)}function ce(t){return v("editSchemas",t)}function se(t){return b("schemas",t)}function le(t,e){var r=te({},(0,c.select)("rank-math").getEditSchemas());return r[t]=e,v("editSchemas",r)}function pe(t,e){var r=te({},(0,c.select)("rank-math").getSchemas());return r[t]=e,b("schemas",r)}function fe(t){var e=te({},(0,c.select)("rank-math").getSchemas());return delete e[t],(0,p.doAction)("rank_math_schema_trash",t),b("schemas",e,"rank_math_delete_"+t,"")}function de(t,e,r){return Zt()({method:"POST",path:"rankmath/v1/saveTemplate",data:{schema:t,postId:r}}).then(function(r){e({loading:!1,showNotice:!0,postId:r.id}),setTimeout(function(){e({showNotice:!1}),(0,a.get)(rankMath,"isTemplateScreen",!1)&&(document.title=(0,u.__)("Edit Schema","seo-by-rank-math"),window.history.pushState(null,"",r.link.replace(/&/g,"&")))},2e3),rankMath.schemaTemplates.push({schema:t,title:t.metadata.title,type:t["@type"]})}),e({loading:!0}),{type:"DONT_WANT_TO_DO_SOMETHING"}}function me(t){return b("contentAIScore",t,"rank_math_contentai_score",t)}function he(t){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},he(t)}function ye(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function ge(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ye(Object(r),!0).forEach(function(e){be(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ye(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function be(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=he(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=he(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==he(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ve=function(t){var e=t.assessor.serpData,r=t.assessor.hasRedirection;return{postID:null,title:e.title?e.title:e.titleTemplate,description:e.description,keywords:e.focusKeywords?e.focusKeywords:"",pillarContent:e.pillarContent,featuredImage:"",permalink:!1,primaryTerm:e.primaryTerm,robots:e.robots,advancedRobots:e.advancedRobots,canonicalUrl:e.canonicalUrl,breadcrumbTitle:e.breadcrumbTitle,showScoreFrontend:e.showScoreFrontend,lockModifiedDate:e.lockModifiedDate,redirectionID:r?(0,a.get)(t.assessor,"redirection.id",""):"",redirectionType:r?(0,a.get)(t.assessor,"redirection.header_code",""):"",redirectionUrl:r?(0,a.get)(t.assessor,"redirection.url_to",""):"",facebookTitle:e.facebookTitle,facebookImage:e.facebookImage,facebookImageID:e.facebookImageID,facebookAuthor:e.facebookAuthor,facebookDescription:e.facebookDescription,facebookHasOverlay:e.facebookHasOverlay,facebookImageOverlay:e.facebookImageOverlay,twitterTitle:e.twitterTitle,twitterImage:e.twitterImage,twitterAuthor:e.twitterAuthor,twitterImageID:e.twitterImageID,twitterCardType:e.twitterCardType,twitterUseFacebook:e.twitterUseFacebook,twitterDescription:e.twitterDescription,twitterHasOverlay:e.twitterHasOverlay,twitterImageOverlay:e.twitterImageOverlay,twitterPlayerUrl:e.twitterPlayerUrl,twitterPlayerSize:e.twitterPlayerSize,twitterPlayerStream:e.twitterPlayerStream,twitterPlayerStreamCtype:e.twitterPlayerStreamCtype,twitterAppDescription:e.twitterAppDescription,twitterAppIphoneName:e.twitterAppIphoneName,twitterAppIphoneID:e.twitterAppIphoneID,twitterAppIphoneUrl:e.twitterAppIphoneUrl,twitterAppIpadName:e.twitterAppIpadName,twitterAppIpadID:e.twitterAppIpadID,twitterAppIpadUrl:e.twitterAppIpadUrl,twitterAppGoogleplayName:e.twitterAppGoogleplayName,twitterAppGoogleplayID:e.twitterAppGoogleplayID,twitterAppGoogleplayUrl:e.twitterAppGoogleplayUrl,twitterAppCountry:e.twitterAppCountry,schemas:(0,a.get)(t,"schemas",{}),score:0,dirtyMetadata:{}}};function we(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ve(rankMath),e=arguments.length>1?arguments[1]:void 0,r=ge({},t.dirtyMetadata);return!1!==e.metaKey&&(r[e.metaKey]=e.metaValue),"RESET_STORE"===e.type?ge({},ve(e.value)):"RANK_MATH_APP_DATA"===e.type?"dirtyMetadata"===e.key?ge(ge({},t),{},{dirtyMetadata:e.value}):ge(ge({},t),{},be(be({},e.key,e.value),"dirtyMetadata",r)):t}function ke(t){return ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ke(t)}function _e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Se(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_e(Object(r),!0).forEach(function(e){Pe(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Pe(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=ke(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ke(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ke(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Te={isLoaded:!1,isPro:!1,selectedKeyword:{tag:"",index:0,data:{value:""}},hasRedirect:rankMath.assessor.hasRedirection&&!(0,a.isEmpty)((0,a.get)(rankMath.assessor,"redirection.id",""))&&!(0,a.isEmpty)((0,a.get)(rankMath.assessor,"redirection.url_to","")),serpTitle:"",serpSlug:"",serpDescription:(0,a.get)(rankMath.assessor,"serpData.description",""),isSnippetEditorOpen:!1,snippetPreviewType:"",refreshResults:"",redirectionItem:{},socialTab:"facebook",highlightedParagraphs:[],editorTab:"",templateTab:"",editSchemas:{},editingSchemaId:"",isSchemaEditorOpen:!1,isSchemaTemplatesOpen:!1,schemaUpdated:!1,isDiviRankMathModalActive:!1,isDiviPageSettingsBarActive:!1};function Oe(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Te,e=arguments.length>1?arguments[1]:void 0;return"RANK_MATH_APP_UI"===e.type?Se(Se({},t),{},Pe({},e.key,e.value)):t}function De(t){return t.appData}function Ee(t){return t.appData.dirtyMetadata}function Ie(t){return t.appData.score}function je(t){return t.appData.keywords}function Ae(t){return t.appData.pillarContent}function Me(t){return t.appData.robots}function Ce(t){return t.appData.advancedRobots}function Re(t){return t.appData.canonicalUrl}function Ue(t){return t.appData.breadcrumbTitle}function Ne(t){return"todo"}function Fe(t){return t.appData.showScoreFrontend}function xe(t){return t.appData.lockModifiedDate}function Le(t){return t.appUi.isLoaded}function Ke(t){return t.appUi.selectedKeyword}function He(t){return t.appUi.socialTab}function Be(t){return t.appUi.refreshResults}function ze(t){return t.appUi.isPro}function Ge(t){return t.appUi.isDiviPageSettingsBarActive}function Ve(t){return t.appUi.isDiviRankMathModalActive}function We(t){return t.appUi.highlightedParagraphs}function qe(t){return t.appData.facebookTitle}function $e(t){return t.appData.facebookDescription}function Je(t){return t.appData.facebookAuthor}function Qe(t){return t.appData.facebookImageID}function Ze(t){return t.appData.facebookImage}function Ye(t){return t.appData.facebookHasOverlay}function Xe(t){return""!==t.appData.facebookImageOverlay?t.appData.facebookImageOverlay:"play"}function tr(t){return t.appData.postID}function er(t){return t.appData.title}function rr(t){return t.appData.permalink}function nr(t){return t.appData.description}function or(t){return t.appData.featuredImage}function ir(t){var e=t.appData.featuredImage;return'<img src="'.concat(e.source_url,'" alt="').concat(e.alt_text,'" >')}function ar(t){return t.appData.primaryTerm}function ur(t){return String(t.appData.redirectionID)}function cr(t){return t.appData.redirectionType}function sr(t){return t.appData.redirectionUrl}function lr(t){return t.appUi.redirectionItem}function pr(t){return t.appUi.hasRedirect}const fr=wp.url;function dr(t){return ct(t.appUi.serpTitle)}function mr(t){return(0,fr.safeDecodeURIComponent)(t.appUi.serpSlug)}function hr(t){return t.appUi.serpDescription}function yr(t){return t.appUi.isSnippetEditorOpen}function gr(t){return t.appUi.snippetPreviewType}function br(t){return t.appUi.isSchemaEditorOpen}function vr(t){return t.appUi.isSchemaTemplatesOpen}function wr(t){return t.appUi.schemaUpdated}function kr(t){return t.appData.schemas}function _r(t){return t.appUi.editSchemas}function Sr(t){return{id:t.appUi.editingSchemaId,data:t.appUi.editSchemas[t.appUi.editingSchemaId]}}function Pr(t){return t.appData.schemas[t.appUi.editingSchemaId]}function Tr(t){return t.appUi.editorTab}function Or(t){return t.appUi.templateTab}function Dr(t){return t.appData.twitterUseFacebook}function Er(t){return t.appData.twitterCardType}function Ir(t){return t.appData.twitterTitle}function jr(t){return t.appData.twitterDescription}function Ar(t){return t.appData.twitterAuthor}function Mr(t){return t.appData.twitterImageID}function Cr(t){return t.appData.twitterImage}function Rr(t){return t.appData.twitterHasOverlay}function Ur(t){return""!==t.appData.twitterImageOverlay?t.appData.twitterImageOverlay:"play"}function Nr(t){return t.appData.twitterAppDescription}function Fr(t){return t.appData.twitterAppIphoneID}function xr(t){return t.appData.twitterAppIphoneName}function Lr(t){return t.appData.twitterAppIphoneUrl}function Kr(t){return t.appData.twitterAppIpadID}function Hr(t){return t.appData.twitterAppIpadName}function Br(t){return t.appData.twitterAppIpadUrl}function zr(t){return t.appData.twitterAppGoogleplayID}function Gr(t){return t.appData.twitterAppGoogleplayName}function Vr(t){return t.appData.twitterAppGoogleplayUrl}function Wr(t){return t.appData.twitterAppCountry}function qr(t){return t.appData.twitterPlayerUrl}function $r(t){return t.appData.twitterPlayerSize}function Jr(t){return t.appData.twitterPlayerStream}function Qr(t){return t.appData.twitterPlayerStreamCtype}var Zr=(0,c.registerStore)("rank-math",{reducer:(0,c.combineReducers)(e),selectors:n,actions:t});function Yr(){return Zr}var Xr=r(6942),tn=r.n(Xr);function en(t){return 100<t?"bad-fk dark":80<t?"good-fk":50<t?"ok-fk":"bad-fk"}r.dn(en);const rn=(0,c.withSelect)(function(t){var e=t("rank-math");return{score:e.getAnalysisScore(),isRefreshing:e.isRefreshing()}})(function(t){var e=t.score;return wp.element.createElement("div",{className:"seo-score "+en(e)},wp.element.createElement("div",{className:"score-text"},e," / 100"))});function nn(t){return nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nn(t)}function on(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=nn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=nn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==nn(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const an=(0,c.withSelect)(function(t){var e=t("rank-math");return{isLoaded:e.isLoaded(),score:e.getAnalysisScore()}})(function(t){var e=t.isLoaded,r=t.score,n=tn()("rank-math-toolbar-score",on(on({},en(r),!0),"loading",!e));return wp.element.createElement("div",{className:n},wp.element.createElement("i",{className:"rm-icon rm-icon-rank-math"}),wp.element.createElement(rn,null))}),un=wp.components;function cn(t){return cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cn(t)}function sn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ln(n.key),n)}}function ln(t){var e=function(t,e){if("object"!=cn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=cn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==cn(e)?e:e+""}function pn(t,e,r){return e=dn(e),function(t,e){if(e&&("object"==cn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,fn()?Reflect.construct(e,r||[],dn(t).constructor):e.apply(t,r))}function fn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(fn=function(){return!!t})()}function dn(t){return dn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},dn(t)}function mn(t,e){return mn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mn(t,e)}var hn=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=pn(this,e,arguments)).onChange=t.onChange.bind(t),t.state={loading:!0,availableTerms:[],selectedTerms:[]},t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mn(t,e)}(e,t),function(t,e,r){return e&&sn(t.prototype,e),r&&sn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"componentDidMount",value:function(){this.fetchTerms()}},{key:"componentWillUnmount",value:function(){(0,a.invoke)(this.fetchRequest,["abort"])}},{key:"componentDidUpdate",value:function(t,e){if(t.selectedTermIds.length<this.props.selectedTermIds.length){var r=(0,a.difference)(this.props.selectedTermIds,t.selectedTermIds)[0];if(!this.termIsAvailable(r))return void this.fetchTerms()}t.selectedTermIds!==this.props.selectedTermIds&&this.updateSelectedTerms(this.state.availableTerms,this.props.selectedTermIds),e.selectedTerms!==this.state.selectedTerms&&this.handleSelectedTermsChange()}},{key:"termIsAvailable",value:function(t){return!!this.state.availableTerms.find(function(e){return e.id===t})}},{key:"updateSelectedTerms",value:function(t,e){this.setState({selectedTerms:this.filterSelectedTerms(t,e)})}},{key:"handleSelectedTermsChange",value:function(){var t=this.state.selectedTerms,e=this.props.primaryTermID;t.find(function(t){return t.id===e})||this.onChange(t.length?t[0].id:"")}},{key:"fetchTerms",value:function(){var t=this,e=this.props.taxonomy;e&&(this.fetchRequest=Zt()({path:(0,fr.addQueryArgs)("/wp/v2/".concat(e.rest_base),{per_page:-1,orderby:"count",order:"desc",_fields:"id,name"})}),this.fetchRequest.then(function(e){t.fetchRequest=null,t.setState({loading:!1,availableTerms:e,selectedTerms:t.filterSelectedTerms(e,t.props.selectedTermIds)})},function(e){"abort"!==e.statusText&&(t.fetchRequest=null,t.setState({loading:!1}))}))}},{key:"filterSelectedTerms",value:function(t,e){return t.filter(function(t){return e.includes(t.id)})}},{key:"onChange",value:function(t){(0,c.dispatch)("rank-math").updatePrimaryTermID(t,this.props.taxonomy.slug)}},{key:"shouldComponentUpdate",value:function(t,e){return this.props.selectedTermIds!==t.selectedTermIds||this.props.primaryTermID!==t.primaryTermID||this.state.selectedTerms!==e.selectedTerms}},{key:"render",value:function(){return this.state.selectedTerms.length<2?null:this.state.loading?[wp.element.createElement(un.Spinner,{key:"spinner"}),wp.element.createElement("p",{key:"spinner-text"},(0,u.__)("Loading","seo-by-rank-math"))]:wp.element.createElement(un.SelectControl,{label:(0,u.__)("Select Primary Term","seo-by-rank-math"),value:this.props.primaryTermID,options:this.state.selectedTerms.map(function(t){return{value:t.id,label:(0,a.unescape)(t.name)}}),onChange:this.onChange,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})}}])}(s.Component);function yn(t){return yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yn(t)}function gn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,bn(n.key),n)}}function bn(t){var e=function(t,e){if("object"!=yn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=yn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==yn(e)?e:e+""}function vn(t,e,r){return e=kn(e),function(t,e){if(e&&("object"==yn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,wn()?Reflect.construct(e,r||[],kn(t).constructor):e.apply(t,r))}function wn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(wn=function(){return!!t})()}function kn(t){return kn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kn(t)}function _n(t,e){return _n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_n(t,e)}var Sn=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),vn(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_n(t,e)}(e,t),function(t,e,r){return e&&gn(t.prototype,e),r&&gn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(e)}(hn);const Pn=(0,c.withSelect)(function(t,e){var r=e.slug,n=t("core").getTaxonomy(r),o=t("core/editor").getEditedPostAttribute;return{taxonomy:n,selectedTermIds:n?o(n.rest_base):[],primaryTermID:t("rank-math").getPrimaryTermID()}})(Sn);const Tn=function(t){var e=t.TermComponent;return function(t){return!1!==rankMath.assessor.primaryTaxonomy&&t.slug===rankMath.assessor.primaryTaxonomy.name}(t)?wp.element.createElement(s.Fragment,null,wp.element.createElement(e,t),wp.element.createElement(un.PanelRow,{className:"rank-math-primary-term-picker"},wp.element.createElement(Pn,t))):wp.element.createElement(e,t)};const On=function(){return!((0,a.isNil)(window.wp)||(0,a.isNil)(wp.data)||(0,a.isNil)(wp.data.select("core/editor"))||!window.document.body.classList.contains("block-editor-page")||!(0,a.isFunction)(wp.data.select("core/editor").getEditedPostAttribute))};function Dn(t){return Dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dn(t)}function En(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function In(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?En(Object(r),!0).forEach(function(e){jn(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):En(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function jn(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Dn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Dn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Dn(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function An(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Mn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Mn(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}const Cn=function(t){var e=t.suggestions,r=t.useFocusKeyword,n=t.onCopy,o=t.onInsert,i=An((0,s.useState)({}),2),a=i[0],c=i[1],l=function(t){c(function(e){return In(In({},e),{},jn({},t,!0))}),setTimeout(function(){c(function(e){var r=In({},e);return delete r[t],r})},1500)};return 0===e.length?wp.element.createElement("em",null,wp.element.createElement("small",null,(0,u.__)("We can't show any link suggestions for this post. Try selecting categories and tags for this post, and mark other posts as Pillar Content to make them show up here.","seo-by-rank-math"))):wp.element.createElement("div",{className:"rank-math-link-suggestions-content","data-count":e.length},e.map(function(t){var e=r&&t.focus_keywords&&t.focus_keywords.length?t.focus_keywords[0]:t.title,i=t.post_id+"_copy",c=t.post_id+"_insert",s=null;return a[i]?s=(0,u.__)("Link Copied","seo-by-rank-math"):a[c]&&(s=(0,u.__)("Link Inserted","seo-by-rank-math")),wp.element.createElement("div",{key:t.post_id,className:"suggestion-item"},wp.element.createElement("button",{type:"button",className:"suggestion-title"},s||wp.element.createElement("a",{href:t.url,target:"_blank",rel:"noreferrer",title:t.title},e)),wp.element.createElement("div",{className:"suggestion-actions"},wp.element.createElement(un.Button,{icon:"clipboard",className:"suggestion-copy",label:(0,u.__)("Copy Link URL to Clipboard","seo-by-rank-math"),showTooltip:!0,onClick:function(){n(t.url),l(i)}}),wp.element.createElement(un.Button,{icon:"admin-links",className:"suggestion-insert",label:(0,u.__)("Insert Link in Content","seo-by-rank-math"),showTooltip:!0,onClick:function(){o(t.url,e),l(c)}})))}))};function Rn(t){return Rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rn(t)}function Un(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Nn(n.key),n)}}function Nn(t){var e=function(t,e){if("object"!=Rn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Rn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Rn(e)?e:e+""}var Fn=function(t,e){for(var r=0,n=0;n<t.length&&r<e;)if("<"===t[n]){for(;n<t.length&&">"!==t[n];)n++;n++}else r++,n++;for(;n<t.length&&"<"===t[n];){for(;n<t.length&&">"!==t[n];)n++;n++}return n},xn=function(t){if("function"==typeof window.ClipboardJS){var e=document.createElement("button");document.body.appendChild(e);var r=new window.ClipboardJS(e,{text:function(){return t}});return e.click(),r.destroy(),void document.body.removeChild(e)}var n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)},Ln=function(t,e){var r=document.createElement("a");return r.setAttribute("href",t),r.textContent=e,r.outerHTML},Kn=function(t,e){var r=(0,c.select)("core/block-editor"),n=Ln(t,e),o=r.getSelectedBlock();if(o&&o.attributes&&"content"in o.attributes){var i=r.getSelectionStart(),a=r.getSelectionEnd(),u=function(e,r,o){if(null!==r&&null!==o&&r!==o){var i=Fn(e,r),a=Fn(e,o),u=e.substring(i,a);return e.substring(0,i)+function(t,e){var r=document.createElement("a");return r.setAttribute("href",t),r.innerHTML=e,r.outerHTML}(t,u)+e.substring(a)}if(null!==r){var c=Fn(e,r);return e.substring(0,c)+n+e.substring(c)}return e+n}(o.attributes.content||"",i?i.offset:null,a?a.offset:null);(0,c.dispatch)("core/block-editor").updateBlock(o.clientId,{attributes:{content:u}})}else for(var s=r.getBlocks(),l=s.length-1;l>=0;l--)if("content"in(s[l].attributes||{})){(0,c.dispatch)("core/block-editor").updateBlock(s[l].clientId,{attributes:{content:(s[l].attributes.content||"")+n}});break}},Hn=function(){return function(t,e,r){return e&&Un(t.prototype,e),r&&Un(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),"post"===rankMath.objectType&&rankMath.postSettings.linkSuggestions&&(this.renderToWrapper(),i().fn.extend({insertLink:function(t,e){var r=this[0],n="";if(r.selectionStart||"0"===r.selectionStart){var o=r.selectionStart,i=r.selectionEnd,a=r.scrollTop;n=Ln(t,r.value.substring(o,i)),o===i&&(n=Ln(t,e)),r.value=r.value.substring(0,o)+n+r.value.substring(i,r.value.length),r.focus(),r.selectionStart=o+n.length,r.selectionEnd=o+n.length,r.scrollTop=a}else n=Ln(t,e),r.value+=n,r.focus()}}))},[{key:"renderToWrapper",value:function(){var t=document.getElementById("rank-math-link-suggestions-wrapper");if(t){var e=rankMath.postSettings,r=e.linkSuggestionsData,n=e.useFocusKeyword;if(!1!==r){this._root||(this._root=(0,s.createRoot)(t)),this._root.render(wp.element.createElement(Cn,{suggestions:r||[],useFocusKeyword:n,onCopy:xn,onInsert:function(t,e){if("object"===("undefined"==typeof tinymce?"undefined":Rn(tinymce))&&null!==tinymce.activeEditor&&!0!==tinymce.activeEditor.isHidden()&&"content"===tinymce.activeEditor.id){var r=tinymce.activeEditor,n=i()(r.getBody()),o=r.selection.getContent()||"";if(n.find("a[data-mce-selected]").length){var a=r.selection.getStart(),u=r.dom.getParent(a,"a[href]");if(!u){var c=r.selection.getContent({format:"raw"});if(c&&-1!==c.indexOf("</a>")){var s=c.match(/href="([^">]+)"/);s&&s[1]&&(u=r.$('a[href="'+s[1]+'"]',a)[0])&&r.selection.select(u)}}u&&(r.dom.setAttribs(u,{href:t}),i()(u).text()!==o&&r.insertContent(o))}else o.length?r.insertContent(Ln(t,o)):r.insertContent(Ln(t,e))}else On()&&Kn(t,e)}}))}}}}])}();const Bn=Hn,zn=function(){return!(0,a.isNull)(document.getElementById("site-editor"))};r.dn(zn);const Gn=function(){if(!zn())return!1;var t=wp.data.select("core/editor"),e=t.getCurrentPostId();if(rankMath.frontPageId&&rankMath.frontPageId===e)return!0;var r=t.getCurrentTemplateId()||e;return!(!(0,a.endsWith)(r,"//home")&&!(0,a.endsWith)(r,"//front-page"))||!(!(0,a.endsWith)(r,"//page")&&!(0,a.endsWith)(r,"//index"))&&"/"===new URLSearchParams(window.location.search).get("p")};r.dn(Gn);const Vn=rankMathAnalyzer;var Wn={};(0,a.isUndefined)(rankMath.assessor)||(0,a.forEach)(rankMath.assessor.diacritics,function(t,e){return Wn[e]=new RegExp(t,"g")});const qn=function(t){if((0,a.isUndefined)(t))return t;for(var e in Wn)t=t.replace(Wn[e],e);return t};r.dn(qn);var $n={"&":"&",""":'"',"'":"'"},Jn=/&(?:amp|quot|#(0+)?39);/g,Qn=RegExp(Jn.source);const Zn=function(t){return t&&Qn.test(t)?t.replace(Jn,function(t){return $n[t]||"'"}):t||""};function Yn(t){return Yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yn(t)}function Xn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,to(n.key),n)}}function to(t){var e=function(t,e){if("object"!=Yn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Yn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Yn(e)?e:e+""}var eo=function(){return function(t,e,r){return e&&Xn(t.prototype,e),r&&Xn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.analyzer=new Vn.Analyzer({i18n:u,analyses:rankMath.assessor.researchesTests}),this.dataCollector=e,this.registerRefresh(),this.updateKeywordResult=this.updateKeywordResult.bind(this),this.sanitizeData=this.sanitizeData.bind(this),(0,p.addAction)("rankMath_analysis_keywordUsage_updated","rank-math",this.updateKeywordResult),(0,p.addFilter)("rank_math_sanitize_meta_value","rank-math",this.sanitizeData),(0,p.addFilter)("rank_math_sanitize_data","rank-math",this.sanitizeData)},[{key:"updateKeywordResult",value:function(t,e){rankMathEditor.resultManager.update(t,{keywordNotUsed:e}),t===this.getSelectedKeyword().toLowerCase()&&(0,c.dispatch)("rank-math").refreshResults()}},{key:"sanitizeData",value:function(t,e){return"schemas"===e||(0,a.isObject)(t)||(0,a.isEmpty)(t)?t:(r=t,(0,a.isUndefined)(r)?"":(0,a.flow)([$,Q,q,Y])(r));var r}},{key:"getPaper",value:function(t,e){var r=Yr().getState(),n=this.dataCollector.getData(),o=new Vn.Paper("",{locale:rankMath.localeFull});o.setTitle(r.appUi.serpTitle),o.setPermalink(n.slug),o.setDescription(r.appUi.serpDescription),o.setUrl(n.permalink),o.setText(Zn((0,p.applyFilters)("rank_math_content",n.content))),o.setKeyword(t),o.setKeywords(e),o.setSchema(r.appData.schemas),(0,a.isUndefined)(n.featuredImage)||(o.setThumbnail(n.featuredImage.source_url),o.setThumbnailAltText(qn(n.featuredImage.alt_text)));var i=(0,c.select)("rank-math-content-ai");if(!(0,a.isEmpty)(i)){var u=i.getData(),s=i.getScore();o.setContentAI(s||!(0,a.isEmpty)(u.keyword))}return o}},{key:"registerRefresh",value:function(){var t=this;this.refresh=(0,a.debounce)(function(e){var r=Yr().getState();if(!1!==r.appUi.isLoaded){var n=r.appData.keywords.split(","),o=[];(0,p.doAction)("rank_math_"+e+"_refresh"),n.map(function(e,r){var i=t.getPaper(qn(e),n),a=0===r?rankMath.assessor.researchesTests:t.filterTests(t.getSecondaryKeywordTests());o.push(t.analyzer.analyzeSome(a,i).then(function(t){rankMathEditor.resultManager.update(i.getKeyword(),t,0===r),0===r&&(0,c.dispatch)("rank-math").updateAnalysisScore(rankMathEditor.resultManager.getScore(i.getKeyword()))})),Promise.all(o).then(function(){(0,c.dispatch)("rank-math").refreshResults()})})}},500)}},{key:"getSecondaryKeywordTests",value:function(){return["keywordInContent","lengthContent","keywordInSubheadings","keywordDensity","lengthPermalink","linksHasExternals","linksNotAllExternals","linksHasInternal","titleSentiment","titleHasPowerWords","titleHasNumber","contentHasTOC","contentHasShortParagraphs","contentHasAssets"]}},{key:"getPrimaryKeyword",value:function(){var t=Yr().getState().appData.keywords;return t?qn(t.split(",")[0]):""}},{key:"getSelectedKeyword",value:function(){var t=Yr().getState(),e=""!==t.appUi.selectedKeyword.data.value?t.appUi.selectedKeyword.data.value:t.appData.keywords.split(",")[0];return qn(e)}},{key:"getResearch",value:function(t){return this.analyzer.researcher.getResearch(t)}},{key:"filterTests",value:function(t){return(0,a.intersection)(t,rankMath.assessor.researchesTests)}}])}();const ro=eo;function no(t){return no="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},no(t)}function oo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,io(n.key),n)}}function io(t){var e=function(t,e){if("object"!=no(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=no(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==no(e)?e:e+""}var ao=function(){return function(t,e,r){return e&&oo(t.prototype,e),r&&oo(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(rankMath.is_front_page||Gn())&&((0,p.addFilter)("rankMath_analysis_contentLength","rank-math",this.contentLength),(0,p.addFilter)("rankMath_analysis_contentLength_boundaries","rank-math",this.contentLengthBoundary))},[{key:"contentLength",value:function(t){return{hasScore:t.hasScore,failed:(0,u.__)("Content is %1$d words long. Consider using at least 300 words.","seo-by-rank-math"),tooltipText:(0,u.__)("Minimum recommended content length should be 300 words.","seo-by-rank-math"),emptyContent:(0,u.sprintf)((0,u.__)("Content should be %1$s long.","seo-by-rank-math"),'<a href="https://rankmath.com/kb/score-100-in-tests/?utm_source=Plugin&utm_campaign=WP#overall-content-length" target="_blank">'+(0,u.__)("300 words","seo-by-rank-math")+"</a>")}}},{key:"contentLengthBoundary",value:function(){return{recommended:{boundary:299,score:8},belowRecommended:{boundary:200,score:5},low:{boundary:50,score:2}}}}])}();const uo=ao;function co(t){return co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},co(t)}function so(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,lo(n.key),n)}}function lo(t){var e=function(t,e){if("object"!=co(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=co(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==co(e)?e:e+""}var po=function(){return function(t,e,r){return e&&so(t.prototype,e),r&&so(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},[{key:"setup",value:function(t){Yr(),this.resultManager=new Vn.ResultManager,this.assessor=new ro(t),new uo,(0,p.doAction)("rank_math_loaded")}},{key:"refresh",value:function(t){this.assessor.refresh(t)}},{key:"getPrimaryKeyword",value:function(){return this.assessor.getPrimaryKeyword()}},{key:"getSelectedKeyword",value:function(){return this.assessor.getSelectedKeyword()}},{key:"updatePermalink",value:function(t){throw"Implement the function"}},{key:"updatePermalinkSanitize",value:function(t){throw"Implement the function"}}])}();const fo=po;function mo(t){return mo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mo(t)}function ho(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function yo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ho(Object(r),!0).forEach(function(e){go(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ho(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function go(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=mo(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=mo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==mo(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const bo=(0,wp.compose.compose)((0,c.withSelect)(function(t){return{lock:t("rank-math").isModifiedDateLocked()}}),(0,c.withDispatch)(function(t){return{onChange:function(e){t("rank-math").lockModifiedDate(e);var r=wp.data.select("core/editor");if(!(0,a.isUndefined)(r)&&!(0,a.isUndefined)(r.getEditedPostAttribute("meta"))){var n=yo(yo({},r.getEditedPostAttribute("meta")),{},{rank_math_lock_modified_date:e});t("core/editor").editPost({meta:n})}}}}))(function(t){var e=t.lock,r=t.onChange;return wp.element.createElement("div",null,wp.element.createElement(un.ToggleControl,{label:(0,u.__)("Lock Modified Date","seo-by-rank-math"),checked:e,onChange:function(t){return r(t)},__nextHasNoMarginBottom:!0}))});function vo(t){return vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vo(t)}function wo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function ko(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?wo(Object(r),!0).forEach(function(e){So(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wo(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Po(n.key),n)}}function So(t,e,r){return(e=Po(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Po(t){var e=function(t,e){if("object"!=vo(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=vo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==vo(e)?e:e+""}var To=function(){return function(t,e,r){return e&&_o(t.prototype,e),r&&_o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),So(this,"initialize",!1),So(this,"isSavingRedirection",!1),So(this,"isSavingSchemas",!1),So(this,"oldSlug",!1),this._data={id:!1,slug:!1,permalink:!1,content:!1,title:!1,excerpt:!1,featuredImage:!1},this.refresh=this.refresh.bind(this),this.isSavingPost=this.isSavingPost.bind(this),this.getPostAttribute=this.getPostAttribute.bind(this),this.subscribeToGutenberg(),this.lockModifiedDate()},[{key:"lockModifiedDate",value:function(){rankMath.showLockModifiedDate&&(0,l.registerPlugin)("rank-math-lock-last-modified",{render:function(){return wp.element.createElement(f.PluginPostStatusInfo,null,wp.element.createElement(bo,null))}})}},{key:"collectGutenbergData",value:function(){return On()?(this._coreEditorSelect||(this._coreEditorSelect=(0,c.select)("core/editor")),!1===this.oldSlug&&""!==this.getSlug()&&(this.oldSlug=this.getSlug()),{id:this.getPostID(),slug:this.getSlug(),permalink:this.getPermalink(),content:this.getPostAttribute("content"),title:this.getPostAttribute("title"),excerpt:this.getPostAttribute("excerpt"),featuredImage:this.getFeaturedImage()}):{}}},{key:"getPostID",value:function(){return this._coreEditorSelect.getCurrentPostId()}},{key:"getPermalink",value:function(){if(Gn())return rankMath.homeUrl;if("auto-draft"===this.getPostAttribute("status"))return"";var t=this.getPostAttribute("generated_slug");return"auto-draft"!==t&&"en"===rankMath.locale||(t=""),(0,fr.safeDecodeURIComponent)(this._coreEditorSelect.getPermalink())}},{key:"getSlug",value:function(){var t=this.getPostAttribute("generated_slug");return"auto-draft"===t&&(t=""),(0,fr.safeDecodeURIComponent)(this.getPostAttribute("slug")||t)}},{key:"getFeaturedImage",value:function(){var t=this.getPostAttribute("featured_media");if(this.isValidMediaId(t)){var e=(0,c.select)("core").getEntityRecord("postType","attachment",t);if(!(0,a.isUndefined)(e))return e}}},{key:"isValidMediaId",value:function(t){return"number"==typeof t&&0<t}},{key:"getPostAttribute",value:function(t){return On()?(this._coreEditorSelect||(this._coreEditorSelect=(0,c.select)("core/editor")),this._coreEditorSelect.getEditedPostAttribute(t)):""}},{key:"subscribeToGutenberg",value:function(){this.subscriber=(0,a.debounce)(this.refresh,500),(0,c.subscribe)(this.subscriber),(0,c.subscribe)(this.isSavingPost)}},{key:"refresh",value:function(){var t=ko({},this._data);this._data=this.collectGutenbergData(),this.handleEditorChange(t)}},{key:"isSavingPost",value:function(){var t=(0,c.select)("core/editor");if(t&&!t.isAutosavingPost()&&t.isSavingPost()){var e=(0,c.select)("rank-math").getDirtyMetadata();(0,a.isEmpty)(e)||(Zt()({method:"POST",path:"rankmath/v1/updateMeta",data:{objectID:rankMath.objectID,objectType:rankMath.objectType,meta:e,content:(0,p.applyFilters)("rank_math_content",this.getPostAttribute("content"))}}).then(function(t){(0,p.doAction)("rank_math_metadata_updated",t)}),(0,c.dispatch)("rank-math").resetDirtyMetadata()),"publish"===this.getPostAttribute("status")&&(this.saveRedirection(),this.autoCreateRedirectionNotice()),this.saveSchemas()}}},{key:"saveSchemas",value:function(){var t=this;if(!this.isSavingSchemas){var e=(0,c.select)("rank-math").getSchemas();if(!(0,a.isEmpty)(e)&&(0,c.select)("rank-math").hasSchemaUpdated()){this.isSavingSchemas=!0;var r=(0,c.select)("rank-math").getEditSchemas();Zt()({method:"POST",path:"rankmath/v1/updateSchemas",data:{objectID:this.getPostID(),objectType:rankMath.objectType,schemas:e}}).then(function(n){var o=ko({},e),i=ko({},r);(0,a.isEmpty)(n)||(0,a.map)(n,function(t,e){o["schema-"+t]=ko({},o[e]),i["schema-"+t]=ko({},i[e]),delete o[e],delete i[e]}),(0,c.dispatch)("rank-math").updateSchemas(o),(0,c.dispatch)("rank-math").updateEditSchemas(i),setTimeout(function(){(0,c.dispatch)("rank-math").schemaUpdated(!1),(0,p.doAction)("rank_math_schema_changed"),t.isSavingSchemas=!1},2e3)})}}}},{key:"saveRedirection",value:function(){var t=this;if(!this.isSavingRedirection){var e=(0,c.select)("rank-math").getRedirectionItem();if(!(0,a.isEmpty)(e)){this.isSavingRedirection=!0,e.objectID=this.getPostID(),e.redirectionSources=this.getPermalink();var r=(0,c.dispatch)("rank-math"),n=(0,c.dispatch)("core/notices");r.resetRedirection(),Zt()({method:"POST",path:"rankmath/v1/updateRedirection",data:e}).then(function(e){"delete"===e.action?(n.createInfoNotice(e.message,{id:"redirectionNotice"}),r.updateRedirection("redirectionID",0)):"update"===e.action?n.createInfoNotice(e.message,{id:"redirectionNotice"}):"new"===e.action&&(r.updateRedirection("redirectionID",e.id),n.createSuccessNotice(e.message,{id:"redirectionNotice"})),setTimeout(function(){t.isSavingRedirection=!1,n.removeNotice("redirectionNotice")},2e3)})}}}},{key:"autoCreateRedirectionNotice",value:function(){if(rankMath.assessor.hasRedirection&&(0,a.get)(rankMath,["assessor","autoCreateRedirection"],!1)&&!(0,c.select)("core/editor").isEditedPostNew()&&!1!==this.oldSlug){var t=this.getSlug();if(this.oldSlug!==t){var e=(0,c.dispatch)("core/notices");this.oldSlug=t,e.createSuccessNotice((0,u.__)("Auto redirection created.","seo-by-rank-math"),{id:"redirectionAutoCreationNotice"}),setTimeout(function(){e.removeNotice("redirectionAutoCreationNotice")},2e3)}}}},{key:"handleEditorChange",value:function(t){var e=this,r={id:"handleIDChange",slug:"handleSlugChange",title:"handleTitleChange",excerpt:"handleExcerptChange",content:"handleContentChange",featuredImage:"handleFeaturedImageChange"};if(t.id)return this.initialize?void(0,a.forEach)(r,function(r,n){e._data[n]!==t[n]&&e[r](e._data[n])}):(this.initialize=!0,(0,a.forEach)(r,function(t,r){e[t](e._data[r])}),void rankMathEditor.refresh("init"));(0,c.dispatch)("rank-math").refreshResults()}},{key:"handleIDChange",value:function(t){Gn()&&(t=0),(0,c.dispatch)("rank-math").updatePostID(t),(0,c.dispatch)("rank-math").toggleLoaded(!0),(0,p.doAction)("rank_math_id_changed")}},{key:"handleSlugChange",value:function(){""!==this.getSlug()&&!1===this.oldSlug&&(this.oldSlug=this.getSlug()),rankMathEditor.refresh("permalink")}},{key:"handleTitleChange",value:function(t){g.setVariable("title",t),g.setVariable("term",t),g.setVariable("author",t),(0,c.dispatch)("rank-math").updateSerpTitle((0,c.select)("rank-math").getTitle()),rankMathEditor.refresh("title")}},{key:"handleExcerptChange",value:function(t){g.setVariable("excerpt",t),g.setVariable("excerpt_only",t),g.setVariable("wc_shortdesc",t),g.setVariable("seo_description",t),(0,c.dispatch)("rank-math").updateSerpDescription((0,c.select)("rank-math").getDescription())}},{key:"handleFeaturedImageChange",value:function(t){(0,c.dispatch)("rank-math").updateFeaturedImage(t),rankMathEditor.refresh("featuredImage")}},{key:"handleContentChange",value:function(){(0,c.dispatch)("rank-math").updateSerpDescription((0,c.select)("rank-math").getDescription()),rankMathEditor.refresh("content")}},{key:"getData",value:function(){return(0,p.applyFilters)("rank_math_dataCollector_data",this._data)}}])}();const Oo=To,Do=wp.blocks;var Eo=[],Io=function(t){return(0,a.isEmpty)(Eo)||(0,a.forEach)(Eo,function(e){(0,a.forEach)(e,function(e){t+=e})}),t};const jo=function(){var t=(0,c.select)("core"),e=(0,c.select)("core/block-editor");(0,p.addFilter)("rank_math_content","rank-math",Io,11),(0,c.subscribe)((0,a.debounce)(function(){var r=e.getBlocks();if(!(0,a.isEmpty)(r)){var n=!1;(0,a.forEach)(r,function(e){if((0,Do.isReusableBlock)(e)){var r=e.attributes.ref,o=function(t){return t&&t.content?(0,a.isFunction)(t.content)?t.content(t):t.content:""}(t.getEditedEntityRecord("postType","wp_block",r));if(!Eo[r])return Eo[r]={id:r,clientId:e.clientId,content:o},void(n=!0);Eo[r].content!==o&&(Eo[r].content=o,n=!0)}}),n&&rankMathEditor.refresh("content")}},500))};function Ao(t){return Ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ao(t)}function Mo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Co(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Mo(Object(r),!0).forEach(function(e){Ro(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Mo(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Ro(t,e,r){return(e=No(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Uo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,No(n.key),n)}}function No(t){var e=function(t,e){if("object"!=Ao(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ao(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ao(e)?e:e+""}r.dn(jo);var Fo=function(){return function(t,e,r){return e&&Uo(t.prototype,e),r&&Uo(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(0,p.addAction)("rank_math_id_changed","rank-math",this.resetStore),(0,p.addAction)("rank_math_data_changed","rank-math",this.activateButton)},[{key:"resetStore",value:function(){var t=(0,c.select)("core/editor").getCurrentPost(),e=(0,a.isEmpty)(t.rankMath)?rankMath:t.rankMath;if(Gn()){var r=rankMath.homepageData.assessor.serpData;e.assessor=Co(Co({},e.assessor),{},{serpData:Co(Co({},e.assessor.serpData),r)})}if((0,c.dispatch)("rank-math").resetStore(e),Gn()){var n=rankMath.homepageData.assessor.serpData;(0,c.dispatch)("rank-math").updateSerpTitle(n.title||n.titleTemplate),(0,c.dispatch)("rank-math").updateSerpDescription(n.description),(0,c.dispatch)("rank-math").toggleLoaded(!0)}}},{key:"activateButton",value:function(t,e,r){r&&"rank_math_seo_score"!==r&&(0,a.startsWith)(r,"rank_math")&&(0,c.dispatch)("core/editor").editPost(Ro({},r,e))}}])}();const xo=Fo;var Lo=function(){var t=rankMath.postSettings,e=t.linkSuggestions,r=t.useFocusKeyword,n=t.linkSuggestionsData;return e&&!1!==n?wp.element.createElement(f.PluginDocumentSettingPanel,{name:"rank-math-link-suggestions",title:wp.element.createElement(React.Fragment,null,(0,u.__)("Link Suggestions","seo-by-rank-math"),wp.element.createElement("span",{className:"rank-math-tooltip"},wp.element.createElement("em",{className:"dashicons-before dashicons-editor-help"}),wp.element.createElement("span",null,(0,u.__)("Click on the button to copy URL or insert link in content. You can also drag and drop links in the post content.","seo-by-rank-math")))),className:"rank-math-link-suggestions-panel"},wp.element.createElement(Cn,{suggestions:n||[],useFocusKeyword:r,onCopy:xn,onInsert:Kn})):null};function Ko(t){var e,r,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(r=Ko(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}const Ho=function(){for(var t,e,r=0,n="",o=arguments.length;r<o;r++)(t=arguments[r])&&(e=Ko(t))&&(n&&(n+=" "),n+=e);return n};const Bo=t=>(0,s.createElement)("path",t),zo=t=>(0,s.createElement)("rect",t),Go=(0,s.forwardRef)(({className:t,isPressed:e,...r},n)=>{const o={...r,className:Ho(t,{"is-pressed":e})||void 0,"aria-hidden":!0,focusable:!1};return(0,s.createElement)("svg",{...o,ref:n})});function Vo(t){var e=t.height,r=void 0===e?16:e,n=t.width,o=void 0===n?16:n,i=t.style,a=void 0===i?{}:i;return wp.element.createElement(Go,{viewBox:"0 0 32 32",fill:"none",height:r,width:o,style:a},wp.element.createElement(zo,{width:"32",height:"32",fill:"none"}),wp.element.createElement(Bo,{d:"M17.9686 14.1623L26.7065 4H24.6358L17.0488 12.8238L10.9891 4H4L13.1634 17.3432L4 28H6.07069L14.0827 18.6817L20.4822 28H27.4714L17.9681 14.1623H17.9686ZM15.1326 17.4607L14.2041 16.132L6.81679 5.55961H9.99723L15.9589 14.0919L16.8873 15.4206L24.6368 26.5113H21.4564L15.1326 17.4612V17.4607Z",fill:"currentColor"}))}Go.displayName="SVG",r.dn(Vo);const Wo=(0,c.withSelect)(function(t){var e=t("rank-math"),r=e.getTwitterUseFacebook()?e.getFacebookTitle():e.getTwitterTitle();return(0,a.isEmpty)(r)&&(r=e.getSerpTitle()),{title:r,permalink:t("core/editor").getPermalink()}})(function(t){var e=t.title,r=t.permalink,n=encodeURI(r),o=encodeURI(e);return wp.element.createElement(s.Fragment,null,wp.element.createElement("p",null,(0,u.__)("Notify your readers by sharing!","seo-by-rank-math")),wp.element.createElement("div",{className:"rank-math-social-share-buttons"},wp.element.createElement("div",{className:"rank-math-share-button rm-facebook"},wp.element.createElement("a",{href:"https://www.facebook.com/sharer/sharer.php?u="+n,target:"_blank",rel:"noopener noreferrer"},wp.element.createElement(un.Dashicon,{icon:"facebook-alt"}))),wp.element.createElement("div",{className:"rank-math-share-button rm-twitter"},wp.element.createElement("a",{href:"https://twitter.com/share?url="+n+"&text="+o,target:"_blank",rel:"noopener noreferrer"},wp.element.createElement(Vo,null))),wp.element.createElement("div",{className:"rank-math-share-button rm-email"},wp.element.createElement("a",{href:"mailto:?subject="+o+"&body="+n,target:"_blank",rel:"noopener noreferrer"},wp.element.createElement(un.Dashicon,{icon:"email"})))),wp.element.createElement("div",{style:{marginTop:"1rem"}},wp.element.createElement("a",{href:"https://www.socialpilot.co/social-media-seo",target:"_blank",rel:"noopener noreferrer",onClick:function(){if(!(0,a.isEmpty)(rankMath.tracking)){var t=rankMath.tracking,e=t.plugin,r=t.email,n=t.language,o=t.path;mixpanel.identify(r),mixpanel.track("Button Clicked",{button:"Schedule this Post Using SocialPilot",context:"wp_plugin",brand:"rankmath",application:"rankmath",plugin:e,path:o,language:n})}}},(0,u.__)("Schedule this Post Using SocialPilot","seo-by-rank-math"))))});var qo=(0,un.createSlotFill)("RankMathAfterEditor"),$o=qo.Fill,Jo=qo.Slot,Qo=function(t){var e=t.children,r=t.className;return wp.element.createElement($o,null,wp.element.createElement(un.PanelRow,{className:r},e))};Qo.Slot=Jo;const Zo=Qo;var Yo=(0,un.createSlotFill)("RankMathAdvancedTab"),Xo=Yo.Fill,ti=Yo.Slot,ei=function(t){var e=t.children,r=t.className;return wp.element.createElement(Xo,null,wp.element.createElement(un.PanelRow,{className:r},e))};ei.Slot=ti;const ri=ei;var ni=(0,un.createSlotFill)("RankMathAfterFocusKeyword"),oi=ni.Fill,ii=ni.Slot,ai=function(t){var e=t.children,r=t.className;return wp.element.createElement(oi,null,wp.element.createElement("div",{className:r},e))};ai.Slot=ii;const ui=ai;function ci(t){return ci="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ci(t)}function si(){return si=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},si.apply(null,arguments)}function li(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,pi(n.key),n)}}function pi(t){var e=function(t,e){if("object"!=ci(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ci(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ci(e)?e:e+""}function fi(t,e,r){return e=hi(e),function(t,e){if(e&&("object"==ci(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,di()?Reflect.construct(e,r||[],hi(t).constructor):e.apply(t,r))}function di(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(di=function(){return!!t})()}function mi(){return mi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=hi(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},mi.apply(null,arguments)}function hi(t){return hi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hi(t)}function yi(t,e){return yi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},yi(t,e)}var gi=function(){var t=(0,c.useSelect)(function(t){return Gn()||!(0,a.isUndefined)(t("core/editor"))&&(0,a.endsWith)(t("core/editor").getCurrentTemplateId(),"//page")});return zn()&&t&&Gn()&&(0,p.doAction)("rank_math_id_changed"),wp.element.createElement(s.Fragment,null,wp.element.createElement(f.PluginSidebarMoreMenuItem,{target:"seo-by-rank-math-sidebar",icon:wp.element.createElement(an,null)},(0,u.__)("Rank Math","seo-by-rank-math")),wp.element.createElement(f.PluginSidebar,{name:"seo-by-rank-math-sidebar",title:(0,u.__)("Rank Math","seo-by-rank-math"),className:"rank-math-sidebar-panel"},(0,p.applyFilters)("rank_math_app",{})()))},bi=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),fi(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yi(t,e)}(e,t),function(t,e,r){return e&&li(t.prototype,e),r&&li(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"setup",value:function(t){Yr(),this.registerSlots=this.registerSlots.bind(this),(0,p.addAction)("rank_math_loaded","rank-math",this.registerSlots,0),function(t,e,r,n){var o=mi(hi(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof o?function(t){return o.apply(r,t)}:o}(e,"setup",this,3)([t]),this.registerPostPublish(),this.registerPrimaryTermSelector(),(0,l.registerPlugin)("rank-math-link-suggestions",{render:Lo}),new Bn,new jo,zn()&&new xo,(0,p.addAction)("rank_math_data_changed","rank-math",this.toggleSettings)}},{key:"toggleSettings",value:function(t,e,r){r&&"rank_math_seo_score"!==r&&((0,c.select)("core/editor").isSavingPost()||(0,c.dispatch)("core/editor").editPost({refreshMe:"refreshUI"}))}},{key:"registerSlots",value:function(){this.registerSidebar(),this.RankMathAfterEditor=Zo,this.RankMathAfterFocusKeyword=ui,this.RankMathAdvancedTab=ri,this.slots={AfterEditor:Zo,AfterFocusKeyword:ui,AdvancedTab:ri}}},{key:"registerSidebar",value:function(){(0,l.registerPlugin)("rank-math",{icon:wp.element.createElement(an,null),render:gi})}},{key:"registerPostPublish",value:function(){(0,l.registerPlugin)("rank-math-post-publish",{render:function(){return wp.element.createElement(f.PluginPostPublishPanel,{initialOpen:!0,title:(0,u.__)("Rank Math","seo-by-rank-math"),className:"rank-math-post-publish",icon:wp.element.createElement(s.Fragment,null)},wp.element.createElement(Wo,null))}})}},{key:"registerPrimaryTermSelector",value:function(){(0,p.addFilter)("editor.PostTaxonomyType","rank-math",function(t){return function(e){return wp.element.createElement(Tn,si({TermComponent:t},e))}})}},{key:"updatePermalink",value:function(t){(0,c.dispatch)("core/editor").editPost({slug:t})}},{key:"updatePermalinkSanitize",value:function(t){t=this.assessor.getResearch("slugify")(t),(0,c.dispatch)("core/editor").editPost({slug:t})}}])}(fo);i()(document).ready(function(){window.rankMathEditor=new bi,window.rankMathGutenberg=window.rankMathEditor,window.rankMathEditor.setup(new Oo)})}()}(); |