编辑文件:classic.js
!function(){"use strict";var t={n:function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,{a:r}),r},d:function(e,r){for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},dn:function(t){(Object.getOwnPropertyDescriptor(t,"name")||{}).writable||Object.defineProperty(t,"name",{value:"default",configurable:!0})}},e={};t.r(e),t.d(e,{deleteSchema:function(){return Ve},lockModifiedDate:function(){return gt},refreshResults:function(){return De},resetDirtyMetadata:function(){return bt},resetRedirection:function(){return Rt},resetStore:function(){return vt},saveSchema:function(){return Ge},saveTemplate:function(){return We},schemaUpdated:function(){return xe},setEditingSchemaId:function(){return Fe},setEditorTab:function(){return Ke},setTemplateTab:function(){return Le},setVersion:function(){return Oe},toggleFrontendScore:function(){return pt},toggleIsDiviPageSettingsBarActive:function(){return Ie},toggleIsDiviRankMathModalActive:function(){return Ee},toggleLoaded:function(){return Se},toggleSchemaEditor:function(){return Ue},toggleSchemaTemplates:function(){return Ne},toggleSnippetEditor:function(){return Xt},updateAIScore:function(){return $e},updateAdvancedRobots:function(){return mt},updateAnalysisScore:function(){return ft},updateAppData:function(){return ut},updateAppUi:function(){return ct},updateBreadcrumbTitle:function(){return yt},updateCanonicalUrl:function(){return dt},updateDescription:function(){return Et},updateEditSchema:function(){return He},updateEditSchemas:function(){return Be},updateFacebookDescription:function(){return wt},updateFacebookHasOverlay:function(){return Pt},updateFacebookImage:function(){return _t},updateFacebookImageID:function(){return St},updateFacebookImageOverlay:function(){return Tt},updateFacebookTitle:function(){return kt},updateFeaturedImage:function(){return jt},updateHasRedirect:function(){return Ut},updateHighlightedParagraphs:function(){return je},updateKeywords:function(){return st},updatePermalink:function(){return Ot},updatePillarContent:function(){return lt},updatePostID:function(){return Dt},updatePrimaryTermID:function(){return At},updateRedirection:function(){return Ct},updateRedirectionItem:function(){return Mt},updateRobots:function(){return ht},updateSchemas:function(){return ze},updateSelectedKeyword:function(){return Pe},updateSerpDescription:function(){return Qt},updateSerpSlug:function(){return Jt},updateSerpTitle:function(){return qt},updateSnippetPreviewType:function(){return Yt},updateSocialTab:function(){return Te},updateTitle:function(){return It},updateTwitterAppCountry:function(){return _e},updateTwitterAppDescription:function(){return fe},updateTwitterAppGoogleplayID:function(){return ve},updateTwitterAppGoogleplayName:function(){return ke},updateTwitterAppGoogleplayUrl:function(){return we},updateTwitterAppIpadID:function(){return ye},updateTwitterAppIpadName:function(){return ge},updateTwitterAppIpadUrl:function(){return be},updateTwitterAppIphoneID:function(){return de},updateTwitterAppIphoneName:function(){return me},updateTwitterAppIphoneUrl:function(){return he},updateTwitterAuthor:function(){return ne},updateTwitterCardType:function(){return te},updateTwitterDescription:function(){return re},updateTwitterHasOverlay:function(){return oe},updateTwitterImage:function(){return ie},updateTwitterImageID:function(){return ae},updateTwitterImageOverlay:function(){return ue},updateTwitterPlayerSize:function(){return se},updateTwitterPlayerStreamCtype:function(){return pe},updateTwitterPlayerStreamUrl:function(){return le},updateTwitterPlayerUrl:function(){return ce},updateTwitterTitle:function(){return ee},updateTwitterUseFacebook:function(){return Zt}});var r={};t.r(r),t.d(r,{appData:function(){return Ze},appUi:function(){return ir}});var n={};t.r(n),t.d(n,{getAdvancedRobots:function(){return fr},getAnalysisScore:function(){return cr},getAppData:function(){return or},getBreadcrumbTitle:function(){return mr},getCanonicalUrl:function(){return dr},getDescription:function(){return Nr},getDirtyMetadata:function(){return ur},getEditSchemas:function(){return en},getEditingSchema:function(){return rn},getEditorTab:function(){return an},getFacebookAuthor:function(){return Ir},getFacebookDescription:function(){return Or},getFacebookHasOverlay:function(){return Ar},getFacebookImage:function(){return jr},getFacebookImageID:function(){return Er},getFacebookImageOverlay:function(){return Cr},getFacebookTitle:function(){return Dr},getFeaturedImage:function(){return xr},getFeaturedImageHtml:function(){return Fr},getHighlightedParagraphs:function(){return Tr},getKeywords:function(){return sr},getPermalink:function(){return Ur},getPillarContent:function(){return lr},getPostID:function(){return Mr},getPreviewSchema:function(){return nn},getPrimaryTermID:function(){return Kr},getRedirectionID:function(){return Lr},getRedirectionItem:function(){return Hr},getRedirectionType:function(){return Br},getRedirectionUrl:function(){return zr},getRichSnippets:function(){return hr},getRobots:function(){return pr},getSchemas:function(){return tn},getSelectedKeyword:function(){return vr},getSerpDescription:function(){return qr},getSerpSlug:function(){return $r},getSerpTitle:function(){return Wr},getShowScoreFrontend:function(){return yr},getSnippetPreviewType:function(){return Qr},getSocialTab:function(){return kr},getTemplateTab:function(){return on},getTitle:function(){return Rr},getTwitterAppCountry:function(){return Dn},getTwitterAppDescription:function(){return yn},getTwitterAppGoogleplayID:function(){return Sn},getTwitterAppGoogleplayName:function(){return Pn},getTwitterAppGoogleplayUrl:function(){return Tn},getTwitterAppIpadID:function(){return kn},getTwitterAppIpadName:function(){return wn},getTwitterAppIpadUrl:function(){return _n},getTwitterAppIphoneID:function(){return gn},getTwitterAppIphoneName:function(){return bn},getTwitterAppIphoneUrl:function(){return vn},getTwitterAuthor:function(){return pn},getTwitterCardType:function(){return cn},getTwitterDescription:function(){return ln},getTwitterHasOverlay:function(){return mn},getTwitterImage:function(){return dn},getTwitterImageID:function(){return fn},getTwitterImageOverlay:function(){return hn},getTwitterPlayerSize:function(){return In},getTwitterPlayerStream:function(){return En},getTwitterPlayerStreamCtype:function(){return jn},getTwitterPlayerUrl:function(){return On},getTwitterTitle:function(){return sn},getTwitterUseFacebook:function(){return un},hasRedirect:function(){return Gr},hasSchemaUpdated:function(){return Zr},isDiviPageSettingsBarActive:function(){return Sr},isDiviRankMathModalActive:function(){return Pr},isLoaded:function(){return br},isModifiedDateLocked:function(){return gr},isPro:function(){return _r},isRefreshing:function(){return wr},isSchemaEditorOpen:function(){return Xr},isSchemaTemplatesOpen:function(){return Yr},isSnippetEditorOpen:function(){return Jr}});const a=jQuery;var i=t.n(a);const o=lodash,u=wp.hooks,c=wp.data,s=wp.element,l=rankMathAnalyzer,p=wp.i18n;function f(t){return 100<t?"bad-fk dark":80<t?"good-fk":50<t?"ok-fk":"bad-fk"}t.dn(f);const d=wp.apiFetch;var m=t.n(d),h={"&":"&",""":'"',"'":"'"},y=/&(?:amp|quot|#(0+)?39);/g,g=RegExp(y.source);const b=function(t){return t&&g.test(t)?t.replace(y,function(t){return h[t]||"'"}):t||""},v=function(t){return t.replace(/<\/?[a-z][^>]*?>/gi,"")};t.dn(v);const k=function(t){return t.replace(/<style[^>]*>([\S\s]*?)<\/style>/gim,"")};t.dn(k);const w=function(t){return t.replace(/ | /gi," ").replace(/\s{2,}/g," ").replace(/\s\./g,".").replace(/^\s+|\s+$/g,"")};t.dn(w);const _=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,e)};t.dn(_);const S=function(t){return t.replace(/[‘’‛`]/g,"'").replace(/[“”〝〞〟‟„]/g,'"')};t.dn(S);const P=function(t){return t.replace(/<!--[\s\S]*?-->/g,"")};t.dn(P);const T=function(t){return t.replace(/&\S+?;/g,"")};function D(t){return(0,o.isUndefined)(t)||!t?"":(0,o.flow)([k,_,v,P,T,w,S])(t)}t.dn(T);var O={};(0,o.isUndefined)(rankMath.assessor)||(0,o.forEach)(rankMath.assessor.diacritics,function(t,e){return O[e]=new RegExp(t,"g")});const I=function(t){if((0,o.isUndefined)(t))return t;for(var e in O)t=t.replace(O[e],e);return t};t.dn(I);const E=wp.compose,j=wp.components;function A(t){return A="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},A(t)}function C(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 M(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?C(Object(r),!0).forEach(function(e){R(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function R(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=A(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=A(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==A(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const U=(0,E.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,o.isUndefined)(r)&&!(0,o.isUndefined)(r.getEditedPostAttribute("meta"))){var n=M(M({},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(j.ToggleControl,{label:(0,p.__)("Lock Modified Date","seo-by-rank-math"),checked:e,onChange:function(t){return r(t)},__nextHasNoMarginBottom:!0}))});function N(t){return N="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},N(t)}function x(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function i(r,n,a,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return F(s,"_invoke",function(r,n,a){var i,u,c,s=0,l=a||[],p=!1,f={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,u=0,c=t,f.n=r,o}};function d(r,n){for(u=r,c=n,e=0;!p&&s&&!a&&e<l.length;e++){var a,i=l[e],d=f.p,m=i[2];r>3?(a=m===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=d&&((a=r<2&&d<i[1])?(u=0,f.v=n,f.n=i[1]):d<m&&(a=r<3||i[0]>n||n>m)&&(i[4]=r,i[5]=n,f.n=m,u=0))}if(a||r>1)return o;throw p=!0,n}return function(a,l,m){if(s>1)throw TypeError("Generator is already running");for(p&&1===l&&d(l,m),u=l,c=m;(e=u<2?t:c)||!p;){i||(u?u<3?(u>1&&(f.n=-1),d(u,c)):f.n=c:f.v=c);try{if(s=2,i){if(u||(a="next"),e=i[a]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),u=1);i=t}else if((e=(p=f.n<0)?c:r.call(n,f))!==o)break}catch(e){i=t,u=1,c=e}finally{s=1}}return{value:e,done:p}}}(r,a,i),!0),s}var o={};function u(){}function c(){}function s(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(F(e={},n,function(){return this}),e),p=s.prototype=u.prototype=Object.create(l);function f(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,F(t,a,"GeneratorFunction")),t.prototype=Object.create(p),t}return c.prototype=s,F(p,"constructor",s),F(s,"constructor",c),c.displayName="GeneratorFunction",F(s,a,"GeneratorFunction"),F(p),F(p,a,"Generator"),F(p,n,function(){return this}),F(p,"toString",function(){return"[object Generator]"}),(x=function(){return{w:i,m:f}})()}function F(t,e,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(t){a=0}F=function(t,e,r,n){function i(e,r){F(t,e,function(t){return this._invoke(e,r,t)})}e?a?a(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},F(t,e,r,n)}function K(t,e,r,n,a,i,o){try{var u=t[i](o),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,a)}function L(t){return function(){var e=this,r=arguments;return new Promise(function(n,a){var i=t.apply(e,r);function o(t){K(i,n,a,o,u,"next",t)}function u(t){K(i,n,a,o,u,"throw",t)}o(void 0)})}}function B(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,z(n.key),n)}}function z(t){var e=function(t,e){if("object"!=N(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=N(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==N(e)?e:e+""}var H=function(){return 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 l.Analyzer({i18n:p,analyses:rankMath.assessor.researchesTests}),this.dataCollector=e,this.promises=[],this.hooks(),this.registerRefresh(),this.saveEvent()},e=[{key:"hooks",value:function(){this.updateKeywordResult=this.updateKeywordResult.bind(this),this.sanitizeData=this.sanitizeData.bind(this),this.addScoreElem=this.addScoreElem.bind(this),this.addLockModifiedDate=this.addLockModifiedDate.bind(this),(0,u.addAction)("rankMath_analysis_keywordUsage_updated","rank-math",this.updateKeywordResult),(0,u.addFilter)("rank_math_sanitize_meta_value","rank-math",this.sanitizeData),(0,u.addFilter)("rank_math_sanitize_data","rank-math",this.sanitizeData),(0,u.addAction)("rank_math_loaded","rank-math",this.addLockModifiedDate,11),(0,u.addAction)("rank_math_loaded","rank-math",this.addScoreElem,11)}},{key:"addScoreElem",value:function(){var t=this;rankMath.showScore&&rankMath.canUser.analysis&&rankMath.canUser.general&&(this.scoreElem=i()('<div class="misc-pub-section rank-math-seo-score"></div>'),i()("#misc-publishing-actions").append(this.scoreElem),setTimeout(function(){t.scoreText='<span class="score-text"><span class="score-icon"><i class="rm-icon-rank-math"></i></span> SEO: <strong>'+p.__("Not available","seo-by-rank-math")+"</strong></span>",t.scoreElem.html(t.scoreText),t.scoreText=t.scoreElem.find("strong"),t.fkScoreText='<span class="score-text">'+p.__("Not available","seo-by-rank-math")+"</span>",t.fkScoreElem=i()('<div class="rank-math-seo-score below-focus-keyword">'+t.fkScoreText+"</div>"),t.fkScoreText=t.fkScoreElem.find("span"),i()("#rank-math-metabox-wrapper .rank-math-focus-keyword").find("tags").parent("div").append(t.fkScoreElem),t.updateScore=t.updateScore.bind(t),t.updateScore(),(0,u.addAction)("rank_math_refresh_results","rank-math",t.updateScore)},2e3))}},{key:"addLockModifiedDate",value:function(){var t=i()("#misc-publishing-actions");t.length&&rankMath.showLockModifiedDate&&(t.append('<div class="misc-pub-section rank-math-lock-modified-date" id="rank-math-lock-modified-date"></div>'),(0,s.createRoot)(document.getElementById("rank-math-lock-modified-date")).render(wp.element.createElement(U,null)))}},{key:"updateScore",value:function(){var t=rankMathEditor.resultManager.getScore(rankMathEditor.getPrimaryKeyword()),e=f(t);this.scoreElem.removeClass("loading bad-fk ok-fk good-fk"),this.fkScoreElem.removeClass("loading bad-fk ok-fk good-fk"),this.scoreElem.addClass(e),this.fkScoreElem.addClass(e),this.scoreText.html(t+" / 100"),this.fkScoreText.html(t+" / 100")}},{key:"sanitizeData",value:function(t,e){return"schemas"===e||(0,o.isObject)(t)||(0,o.isEmpty)(t)?t:(r=t,(0,o.isUndefined)(r)?"":(0,o.flow)([k,_,v,P])(r));var r}},{key:"getPaper",value:function(t,e){var r=this.dataCollector.getData(),n=new l.Paper("",{locale:rankMath.localeFull});n.setTitle((0,c.select)("rank-math").getSerpTitle()),n.setPermalink(r.slug),n.setDescription((0,c.select)("rank-math").getSerpDescription()),n.setUrl(r.permalink),n.setText(b((0,u.applyFilters)("rank_math_content",r.content))),n.setKeyword(t),n.setKeywords(e),n.setSchema((0,c.select)("rank-math").getSchemas()),(0,o.isUndefined)(r.featuredImage)||(n.setThumbnail(r.featuredImage.source_url),n.setThumbnailAltText(I(r.featuredImage.alt_text)));var a=(0,c.select)("rank-math-content-ai");if(!(0,o.isEmpty)(a)){var i=a.getData(),s=a.getScore();n.setContentAI(s||!(0,o.isEmpty)(i.keyword))}return n}},{key:"registerRefresh",value:function(){var t=this;this.refresh=(0,o.debounce)(function(e){if(!1!==(0,c.select)("rank-math").isLoaded()){var r=(0,c.select)("rank-math").getKeywords().split(","),n=[];(0,u.doAction)("rank_math_"+e+"_refresh"),r.map(function(e,a){var i=t.getPaper(I(e),r),o=0===a?rankMath.assessor.researchesTests:t.filterTests(t.getSecondaryKeywordTests());n.push(t.analyzer.analyzeSome(o,i).then(function(t){rankMathEditor.resultManager.update(i.getKeyword(),t,0===a),0===a&&(0,c.dispatch)("rank-math").updateAnalysisScore(rankMathEditor.resultManager.getScore(i.getKeyword()))})),Promise.all(n).then(function(){(0,c.dispatch)("rank-math").refreshResults(),t.refreshResults()})})}},500)}},{key:"updateKeywordResult",value:function(t,e){rankMathEditor.resultManager.update(t,{keywordNotUsed:e}),t===rankMathEditor.getSelectedKeyword().toLowerCase()&&(0,c.dispatch)("rank-math").refreshResults()}},{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=(0,c.select)("rank-math").getKeywords();return I(t.split(",")[0])}},{key:"getSelectedKeyword",value:function(){var t=(0,c.select)("rank-math").getKeywords(),e=(0,c.select)("rank-math").getSelectedKeyword(),r=""!==e.data.value?e.data.value:t.split(",")[0];return I(r)}},{key:"getResearch",value:function(t){return this.analyzer.researcher.getResearch(t)}},{key:"refreshResults",value:function(){(0,u.doAction)("rank_math_refresh_results")}},{key:"filterTests",value:function(t){return(0,o.intersection)(t,rankMath.assessor.researchesTests)}},{key:"saveEvent",value:function(){var t=this;if(!(0,o.isUndefined)(this.dataCollector.form)&&!(0,o.isUndefined)(this.dataCollector.updateBtn)){var e=!0;this.dataCollector.form.on("submit",function(r){if(e&&!(0,o.isUndefined)(r.originalEvent)){r.preventDefault();var n=t.dataCollector.updateBtn.data("disable")&&t.dataCollector.saveDraft.length?t.dataCollector.saveDraft:t.dataCollector.updateBtn;n.addClass("disabled").parent().find(".spinner").addClass("is-active"),e=!1;var a=r.originalEvent.submitter||null,u=t.saveMeta(),c=t.saveSchemas(u),s=t.saveRedirection(c),l=function(){if(n.removeClass("disabled"),a){var e=i()(a).attr("name"),r=i()(a).attr("value");e&&t.dataCollector.form.append(i()("<input>",{type:"hidden",name:e,value:r}))}t.dataCollector.form[0].requestSubmit()};return Promise.all([u,c,s]).then(l).catch(l),!1}})}}},{key:"saveMeta",value:function(){return new Promise(function(t){var e=(0,c.select)("rank-math").getDirtyMetadata();(0,o.isEmpty)(e)?t(!0):(m()({method:"POST",path:"rankmath/v1/updateMeta",data:{objectID:rankMath.objectID,objectType:rankMath.objectType,meta:e,content:rankMathEditor.assessor.dataCollector.getContent()}}).then(function(){t(!0)}).catch(function(){t(!0)}),(0,c.dispatch)("rank-math").resetDirtyMetadata())})}},{key:"saveRedirection",value:function(t){return new Promise(function(){var e=L(x().m(function e(r){var n,a,i;return x().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,t;case 1:if(n=(0,c.select)("rank-math").getRedirectionItem(),!(0,o.isEmpty)(n)){e.n=2;break}return r(!0),e.a(2);case 2:n.objectID=window.rankMath.objectID,n.objectType=window.rankMath.objectType,n.redirectionSources=rankMathEditor.assessor.dataCollector.getData("permalink"),a=(0,c.dispatch)("rank-math"),i=(0,c.dispatch)("core/notices"),a.resetRedirection(),m()({method:"POST",path:"rankmath/v1/updateRedirection",data:n}).then(function(t){"delete"===t.action?(i.createInfoNotice(t.message,{id:"redirectionNotice"}),a.updateRedirection("redirectionID",0)):"update"===t.action?i.createInfoNotice(t.message,{id:"redirectionNotice"}):"new"===t.action&&(a.updateRedirection("redirectionID",t.id),i.createSuccessNotice(t.message,{id:"redirectionNotice"})),setTimeout(function(){i.removeNotice("redirectionNotice")},2e3),r(!0)}).catch(function(){r(!0)});case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}())}},{key:"saveSchemas",value:function(t){return new Promise(function(){var e=L(x().m(function e(r){var n;return x().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,t;case 1:if(n=(0,c.select)("rank-math").getSchemas(),!(0,o.isEmpty)(n)&&(0,c.select)("rank-math").hasSchemaUpdated()){e.n=2;break}return r(!0),e.a(2);case 2:m()({method:"POST",path:"rankmath/v1/updateSchemas",data:{objectID:rankMath.objectID,objectType:rankMath.objectType,schemas:n}}).then(function(){r(!0)}).catch(function(){r(!0)});case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}())}}],e&&B(t.prototype,e),r&&B(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();const G=H;const V=function(){return!((0,o.isNil)(window.wp)||(0,o.isNil)(wp.data)||(0,o.isNil)(wp.data.select("core/editor"))||!window.document.body.classList.contains("block-editor-page")||!(0,o.isFunction)(wp.data.select("core/editor").getEditedPostAttribute))},W=function(){return!(0,o.isNull)(document.getElementById("site-editor"))};t.dn(W);const $=function(){if(!W())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,o.endsWith)(r,"//home")&&!(0,o.endsWith)(r,"//front-page"))||!(!(0,o.endsWith)(r,"//page")&&!(0,o.endsWith)(r,"//index"))&&"/"===new URLSearchParams(window.location.search).get("p")};function q(t){return q="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},q(t)}function J(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,Q(n.key),n)}}function Q(t){var e=function(t,e){if("object"!=q(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=q(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==q(e)?e:e+""}t.dn($);const X=function(){return 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||$())&&((0,u.addFilter)("rankMath_analysis_contentLength","rank-math",this.contentLength),(0,u.addFilter)("rankMath_analysis_contentLength_boundaries","rank-math",this.contentLengthBoundary))},(e=[{key:"contentLength",value:function(t){return{hasScore:t.hasScore,failed:(0,p.__)("Content is %1$d words long. Consider using at least 300 words.","seo-by-rank-math"),tooltipText:(0,p.__)("Minimum recommended content length should be 300 words.","seo-by-rank-math"),emptyContent:(0,p.sprintf)((0,p.__)("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,p.__)("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}}}}])&&J(t.prototype,e),r&&J(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Y(t){return Y="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},Y(t)}function Z(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,tt(n.key),n)}}function tt(t){var e=function(t,e){if("object"!=Y(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Y(e)?e:e+""}var et=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.methods=[],this.init=this.init.bind(this),this.refresh=this.refresh.bind(this),(0,u.addAction)("rank_math_loaded","rank-math",this.init)},e=[{key:"init",value:function(){this.methods.length&&rankMathEditor.refresh("content")}},{key:"registerPlugin",value:function(){console.warn("RankMathApp.registerPlugin is deprecated.")}},{key:"refresh",value:function(t){console.warn("RankMathApp.refresh is deprecated, use rankMathEditor.refresh()"),this.methods.push(t)}},{key:"reloadPlugin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"content";console.warn("RankMathApp.reloadPlugin is deprecated, use rankMathEditor.refresh()"),this.refresh(e)}}],e&&Z(t.prototype,e),r&&Z(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();const rt=et;function nt(t){return nt="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},nt(t)}function at(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,it(n.key),n)}}function it(t){var e=function(t,e){if("object"!=nt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=nt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==nt(e)?e:e+""}var ot=new(function(){return t=function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=null,(r=it(r="map"))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n},(e=[{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)}}])&&at(t.prototype,e),r&&at(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}());function ut(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,u.applyFilters)("rank_math_sanitize_data",e,t,r),null!==n&&(n=(0,u.applyFilters)("rank_math_sanitize_meta_value",n,t,r)),n=null===n?e:n,(0,u.doAction)("rank_math_data_changed",t,e,r),{type:"RANK_MATH_APP_DATA",key:t,value:e,metaKey:r,metaValue:n}}function ct(t,e){return(0,u.doAction)("rank_math_update_app_ui",t,e),{type:"RANK_MATH_APP_UI",key:t,value:e}}function st(t){return ot.setVariable("focuskw",t.split(",")[0]),rankMathEditor.refresh("keyword"),ut("keywords",t,"rank_math_focus_keyword")}function lt(t){return ut("pillarContent",t,"rank_math_pillar_content",!0===t?"on":"off")}function pt(t){return ut("showScoreFrontend",t,"rank_math_dont_show_seo_score",!0===t?"off":"on")}function ft(t){return ut("score",t,"rank_math_seo_score")}function dt(t){return ut("canonicalUrl",t,"rank_math_canonical_url")}function mt(t){return ut("advancedRobots",t,"rank_math_advanced_robots")}function ht(t){return ut("robots",t,"rank_math_robots",Object.keys(t))}function yt(t){return ut("breadcrumbTitle",t,"rank_math_breadcrumb_title")}function gt(t){return ut("lockModifiedDate",t,"rank_math_lock_modified_date")}function bt(){return ut("dirtyMetadata",{})}function vt(t){return{type:"RESET_STORE",value:t}}function kt(t){return ut("facebookTitle",t,"rank_math_facebook_title")}function wt(t){return ut("facebookDescription",t,"rank_math_facebook_description")}function _t(t){return ut("facebookImage",t,"rank_math_facebook_image")}function St(t){return ut("facebookImageID",t,"rank_math_facebook_image_id")}function Pt(t){return ut("facebookHasOverlay",t,"rank_math_facebook_enable_image_overlay",!0===t?"on":"off")}function Tt(t){return ut("facebookImageOverlay",t,"rank_math_facebook_image_overlay")}function Dt(t){return rankMath.objectID=t,ut("postID",t)}function Ot(t){return ut("permalink",t,"permalink")}function It(t){return ut("title",t,"rank_math_title")}function Et(t){return ut("description",t,"rank_math_description")}function jt(t){return ut("featuredImage",t)}function At(t,e){return ut("primaryTerm",parseInt(t),"rank_math_primary_"+e)}function Ct(t,e){return ut(t,e)}function Mt(t){return ct("redirectionItem",t)}function Rt(){return ct("redirectionItem",{})}function Ut(t){return ct("hasRedirect",t)}const Nt=wp.autop;var xt="[^<>&/\\[\\]\0- =]+?",Ft=new RegExp("\\["+xt+"( [^\\]]+?)?\\]","g"),Kt=new RegExp("\\[/"+xt+"\\]","g");const Lt=function(t){return t.replace(Ft,"").replace(Kt,"")};t.dn(Lt);const Bt=function(t,e){var r=function(t,e){for(var r,n=/<p(?:[^>]+)?>(.*?)<\/p>/gi,a=[];null!==(r=n.exec(t));)a.push(r);return(0,o.map)(a,function(t){return e?D(t[1]):t[1]})}(t=(0,o.flow)([Lt,P,Nt.autop])(t),e=e||!1);return 0<r.length?r:[e?D(t):t]};t.dn(Bt),t.dn(Ht);var zt=document.createElement("div");function Ht(t){return t&&"string"==typeof t&&(t=t.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"").replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),zt.innerHTML=t,t=zt.textContent,zt.textContent=""),t}t.dn($t);var Gt=function(t,e){return t=(t=D(t)).replace(/\r?\n|\r/g," "),e?(0,o.truncate)(t,{length:e,separator:" "}):t},Vt=function(t){if((0,o.isEmpty)(t))return"";t=_(t),t=k(t),t=(0,o.unescape)(t).replace(/\[caption[^\]]*\](.*)\[\/caption\]/g,"");var e=(0,o.filter)(Bt(t,!0),function(t){return""!==t.trim()});if(!e.length)return"";var r=rankMathEditor.getPrimaryKeyword();if(""!==r){var n=(0,o.filter)(e,function(t){return(0,o.includes)(t.toLowerCase(),r.toLowerCase())});if(0<n.length)return Gt(n[0],160)}return Gt(e[0],160)},Wt=function(t){return!(0,o.isUndefined)(t)&&!(0,o.isEmpty)(t)&&D(t)};function $t(t){var e=rankMathEditor.assessor.dataCollector.getData(),r=e.excerpt,n=Vt(e.content),a=(0,o.isUndefined)(r)||(0,o.isEmpty)(r)?n:(0,o.unescape)(r);if(ot.setVariable("excerpt",a),ot.setVariable("seo_description",a),""!==(t=Ht((0,u.applyFilters)("rankMath/description",t))))return D(t);var i=(0,o.unescape)(rankMath.assessor.serpData.descriptionTemplate);return"term"===rankMath.objectType?Wt(i)||Wt(r)||n:Wt(r)||Wt(i)||n}function qt(t){return t=ot.swap(""!==t?t:rankMath.assessor.serpData.titleTemplate),rankMathEditor.refresh("title"),ct("serpTitle",Ht(t))}function Jt(t){return t=""!==t?t:rankMathEditor.assessor.dataCollector.getSlug(),rankMathEditor.refresh("permalink"),ct("serpSlug",t)}function Qt(t){return t=ot.swap($t(t)),rankMathEditor.refresh("description"),ct("serpDescription",t)}function Xt(t){return ct("isSnippetEditorOpen",t)}function Yt(t){return ct("snippetPreviewType",t)}function Zt(t){return ut("twitterUseFacebook",t,"rank_math_twitter_use_facebook",!0===t?"on":"off")}function te(t){return ut("twitterCardType",t,"rank_math_twitter_card_type")}function ee(t){return ut("twitterTitle",t,"rank_math_twitter_title")}function re(t){return ut("twitterDescription",t,"rank_math_twitter_description")}function ne(t){return ut("twitterAuthor",t,"rank_math_twitter_author")}function ae(t){return ut("twitterImageID",t,"rank_math_twitter_image_id")}function ie(t){return ut("twitterImage",t,"rank_math_twitter_image")}function oe(t){return ut("twitterHasOverlay",t,"rank_math_twitter_enable_image_overlay",!0===t?"on":"off")}function ue(t){return ut("twitterImageOverlay",t,"rank_math_twitter_image_overlay")}function ce(t){return ut("twitterPlayerUrl",t,"rank_math_twitter_player_url")}function se(t){return ut("twitterPlayerSize",t,"rank_math_twitter_player_size")}function le(t){return ut("twitterPlayerStream",t,"rank_math_twitter_player_stream")}function pe(t){return ut("twitterPlayerStreamCtype",t,"rank_math_twitter_player_stream_ctype")}function fe(t){return ut("twitterAppDescription",t,"rank_math_twitter_app_description")}function de(t){return ut("twitterAppIphoneID",t,"rank_math_twitter_app_iphone_id")}function me(t){return ut("twitterAppIphoneName",t,"rank_math_twitter_app_iphone_name")}function he(t){return ut("twitterAppIphoneUrl",t,"rank_math_twitter_app_iphone_url")}function ye(t){return ut("twitterAppIpadID",t,"rank_math_twitter_app_ipad_id")}function ge(t){return ut("twitterAppIpadName",t,"rank_math_twitter_app_ipad_name")}function be(t){return ut("twitterAppIpadUrl",t,"rank_math_twitter_app_ipad_url")}function ve(t){return ut("twitterAppGoogleplayID",t,"rank_math_twitter_app_googleplay_id")}function ke(t){return ut("twitterAppGoogleplayName",t,"rank_math_twitter_app_googleplay_name")}function we(t){return ut("twitterAppGoogleplayUrl",t,"rank_math_twitter_app_googleplay_url")}function _e(t){return ut("twitterAppCountry",t,"rank_math_twitter_app_country")}function Se(t){return ct("isLoaded",t)}function Pe(t){return ct("selectedKeyword",t)}function Te(t){return ct("socialTab",t)}function De(){return ct("refreshResults",Date.now())}function Oe(){return ct("isPro",!0)}function Ie(t){return ct("isDiviPageSettingsBarActive",t)}function Ee(t){return ct("isDiviRankMathModalActive",t)}function je(t){return ct("highlightedParagraphs",t)}function Ae(t){return Ae="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},Ae(t)}function Ce(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 Me(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ce(Object(r),!0).forEach(function(e){Re(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ce(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Re(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Ae(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ae(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ae(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ue(t){return ct("isSchemaEditorOpen",t)}function Ne(t){return ct("isSchemaTemplatesOpen",t)}function xe(t){return ct("schemaUpdated",t)}function Fe(t){return ct("editingSchemaId",t)}function Ke(t){return ct("editorTab",t)}function Le(t){return ct("templateTab",t)}function Be(t){return ct("editSchemas",t)}function ze(t){return ut("schemas",t)}function He(t,e){var r=Me({},(0,c.select)("rank-math").getEditSchemas());return r[t]=e,ct("editSchemas",r)}function Ge(t,e){var r=Me({},(0,c.select)("rank-math").getSchemas());return r[t]=e,ut("schemas",r)}function Ve(t){var e=Me({},(0,c.select)("rank-math").getSchemas());return delete e[t],(0,u.doAction)("rank_math_schema_trash",t),ut("schemas",e,"rank_math_delete_"+t,"")}function We(t,e,r){return m()({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,o.get)(rankMath,"isTemplateScreen",!1)&&(document.title=(0,p.__)("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 $e(t){return ut("contentAIScore",t,"rank_math_contentai_score",t)}function qe(t){return qe="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},qe(t)}function Je(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 Qe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Je(Object(r),!0).forEach(function(e){Xe(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Je(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Xe(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=qe(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=qe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==qe(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ye=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,o.get)(t.assessor,"redirection.id",""):"",redirectionType:r?(0,o.get)(t.assessor,"redirection.header_code",""):"",redirectionUrl:r?(0,o.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,o.get)(t,"schemas",{}),score:0,dirtyMetadata:{}}};function Ze(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ye(rankMath),e=arguments.length>1?arguments[1]:void 0,r=Qe({},t.dirtyMetadata);return!1!==e.metaKey&&(r[e.metaKey]=e.metaValue),"RESET_STORE"===e.type?Qe({},Ye(e.value)):"RANK_MATH_APP_DATA"===e.type?"dirtyMetadata"===e.key?Qe(Qe({},t),{},{dirtyMetadata:e.value}):Qe(Qe({},t),{},Xe(Xe({},e.key,e.value),"dirtyMetadata",r)):t}function tr(t){return tr="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},tr(t)}function er(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 rr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?er(Object(r),!0).forEach(function(e){nr(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):er(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function nr(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=tr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=tr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==tr(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ar={isLoaded:!1,isPro:!1,selectedKeyword:{tag:"",index:0,data:{value:""}},hasRedirect:rankMath.assessor.hasRedirection&&!(0,o.isEmpty)((0,o.get)(rankMath.assessor,"redirection.id",""))&&!(0,o.isEmpty)((0,o.get)(rankMath.assessor,"redirection.url_to","")),serpTitle:"",serpSlug:"",serpDescription:(0,o.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 ir(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ar,e=arguments.length>1?arguments[1]:void 0;return"RANK_MATH_APP_UI"===e.type?rr(rr({},t),{},nr({},e.key,e.value)):t}function or(t){return t.appData}function ur(t){return t.appData.dirtyMetadata}function cr(t){return t.appData.score}function sr(t){return t.appData.keywords}function lr(t){return t.appData.pillarContent}function pr(t){return t.appData.robots}function fr(t){return t.appData.advancedRobots}function dr(t){return t.appData.canonicalUrl}function mr(t){return t.appData.breadcrumbTitle}function hr(t){return"todo"}function yr(t){return t.appData.showScoreFrontend}function gr(t){return t.appData.lockModifiedDate}function br(t){return t.appUi.isLoaded}function vr(t){return t.appUi.selectedKeyword}function kr(t){return t.appUi.socialTab}function wr(t){return t.appUi.refreshResults}function _r(t){return t.appUi.isPro}function Sr(t){return t.appUi.isDiviPageSettingsBarActive}function Pr(t){return t.appUi.isDiviRankMathModalActive}function Tr(t){return t.appUi.highlightedParagraphs}function Dr(t){return t.appData.facebookTitle}function Or(t){return t.appData.facebookDescription}function Ir(t){return t.appData.facebookAuthor}function Er(t){return t.appData.facebookImageID}function jr(t){return t.appData.facebookImage}function Ar(t){return t.appData.facebookHasOverlay}function Cr(t){return""!==t.appData.facebookImageOverlay?t.appData.facebookImageOverlay:"play"}function Mr(t){return t.appData.postID}function Rr(t){return t.appData.title}function Ur(t){return t.appData.permalink}function Nr(t){return t.appData.description}function xr(t){return t.appData.featuredImage}function Fr(t){var e=t.appData.featuredImage;return'<img src="'.concat(e.source_url,'" alt="').concat(e.alt_text,'" >')}function Kr(t){return t.appData.primaryTerm}function Lr(t){return String(t.appData.redirectionID)}function Br(t){return t.appData.redirectionType}function zr(t){return t.appData.redirectionUrl}function Hr(t){return t.appUi.redirectionItem}function Gr(t){return t.appUi.hasRedirect}const Vr=wp.url;function Wr(t){return Ht(t.appUi.serpTitle)}function $r(t){return(0,Vr.safeDecodeURIComponent)(t.appUi.serpSlug)}function qr(t){return t.appUi.serpDescription}function Jr(t){return t.appUi.isSnippetEditorOpen}function Qr(t){return t.appUi.snippetPreviewType}function Xr(t){return t.appUi.isSchemaEditorOpen}function Yr(t){return t.appUi.isSchemaTemplatesOpen}function Zr(t){return t.appUi.schemaUpdated}function tn(t){return t.appData.schemas}function en(t){return t.appUi.editSchemas}function rn(t){return{id:t.appUi.editingSchemaId,data:t.appUi.editSchemas[t.appUi.editingSchemaId]}}function nn(t){return t.appData.schemas[t.appUi.editingSchemaId]}function an(t){return t.appUi.editorTab}function on(t){return t.appUi.templateTab}function un(t){return t.appData.twitterUseFacebook}function cn(t){return t.appData.twitterCardType}function sn(t){return t.appData.twitterTitle}function ln(t){return t.appData.twitterDescription}function pn(t){return t.appData.twitterAuthor}function fn(t){return t.appData.twitterImageID}function dn(t){return t.appData.twitterImage}function mn(t){return t.appData.twitterHasOverlay}function hn(t){return""!==t.appData.twitterImageOverlay?t.appData.twitterImageOverlay:"play"}function yn(t){return t.appData.twitterAppDescription}function gn(t){return t.appData.twitterAppIphoneID}function bn(t){return t.appData.twitterAppIphoneName}function vn(t){return t.appData.twitterAppIphoneUrl}function kn(t){return t.appData.twitterAppIpadID}function wn(t){return t.appData.twitterAppIpadName}function _n(t){return t.appData.twitterAppIpadUrl}function Sn(t){return t.appData.twitterAppGoogleplayID}function Pn(t){return t.appData.twitterAppGoogleplayName}function Tn(t){return t.appData.twitterAppGoogleplayUrl}function Dn(t){return t.appData.twitterAppCountry}function On(t){return t.appData.twitterPlayerUrl}function In(t){return t.appData.twitterPlayerSize}function En(t){return t.appData.twitterPlayerStream}function jn(t){return t.appData.twitterPlayerStreamCtype}(0,c.registerStore)("rank-math",{reducer:(0,c.combineReducers)(r),selectors:n,actions:e});function An(t){return An="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},An(t)}function Cn(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,Mn(n.key),n)}}function Mn(t){var e=function(t,e){if("object"!=An(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=An(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==An(e)?e:e+""}var Rn=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.updateBtn=i()("#publish"),this.form=i()("#post"),this._data={id:!1,slug:!1,permalink:!1,content:!1,title:!1,excerpt:!1,featuredImage:!1,description:""},this.refresh=this.refresh.bind(this),(0,u.addAction)("rank_math_loaded","rank-math",this.refresh),this.setup(),this.init()},e=[{key:"init",value:function(){var t=this;this.elemTitle.on("input",(0,o.debounce)(function(){t.handleTitleChange(t.elemTitle.val())},500)).trigger("input"),this.elemDescription.on("input",(0,o.debounce)(function(){t.handleExcerptChange(t.elemDescription.val())},500)).trigger("input"),this.elemSlug.on("input",(0,o.debounce)(function(){rankMathEditor.updatePermalink(t.elemSlug.val())},500))}},{key:"collectData",value:function(){this._data={id:this.getPostID(),slug:this.getSlug(),permalink:this.getPermalink(),content:this.getContent(),title:this.getTitle(),excerpt:this.getExcerpt(),featuredImage:this.getFeaturedImage()}}},{key:"getPostID",value:function(){return rankMath.objectID}},{key:"getTitle",value:function(){return this.elemTitle.val()}},{key:"getExcerpt",value:function(){var t=this.elemDescription.val();return ot.setVariable("excerpt",t),ot.setVariable("excerpt_only",t),ot.setVariable("wc_shortdesc",t),ot.setVariable("seo_description",t),t}},{key:"getPermalink",value:function(){return this.getSlug()?rankMath.permalinkFormat.replace(/%(postname|pagename|term|author)%/,this.getSlug()):""}},{key:"getSlug",value:function(){return this.elemSlug.val()}},{key:"getFeaturedImage",value:function(){return this.featuredImage}},{key:"refresh",value:function(){this.collectData(),(0,c.dispatch)("rank-math").toggleLoaded(!0),rankMathEditor.refresh("init")}},{key:"handleSlugChange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];("auto-draft"!==this.getStatus()||e)&&this.elemSlug.val(t),i()("#editable-post-name").text(t),i()("#editable-post-name-full").text(t),this._data.slug=this.getSlug(),this._data.permalink=this.getPermalink(),(0,c.dispatch)("rank-math").updateSerpSlug(t),rankMathEditor.refresh("permalink")}},{key:"handleTitleChange",value:function(t){ot.setVariable("title",t),ot.setVariable("term",t),ot.setVariable("author",t),(0,c.dispatch)("rank-math").updateSerpTitle((0,c.select)("rank-math").getTitle()),rankMathEditor.refresh("title")}},{key:"handleExcerptChange",value:function(){this._data.excerpt=this.getExcerpt(),(0,c.dispatch)("rank-math").updateSerpDescription((0,c.select)("rank-math").getDescription()),rankMathEditor.refresh("content")}},{key:"handleFeaturedImageChange",value:function(){this._data.featuredImage=this.getFeaturedImage(),(0,c.dispatch)("rank-math").updateFeaturedImage(this.getFeaturedImage()),rankMathEditor.refresh("featuredImage")}},{key:"handleContentChange",value:function(){this._data.excerpt=this.getExcerpt(),this._data.content=this.getContent(),(0,c.dispatch)("rank-math").updateSerpDescription((0,c.select)("rank-math").getDescription()),rankMathEditor.refresh("content")}},{key:"getData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=t?this._data[t]:this._data;return(0,u.applyFilters)("rank_math_dataCollector_data",e)}},{key:"updateData",value:function(t,e){this._data[t]=e}},{key:"isTinymce",value:function(){return"undefined"!=typeof tinymce}},{key:"getStatus",value:function(){var t=!(0,o.isUndefined)(this.postStatus)&&this.postStatus.length?this.postStatus.val():"";return(0,o.isUndefined)(t)?"":t}}],e&&Cn(t.prototype,e),r&&Cn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();const Un=Rn;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 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,Fn(n.key),n)}}function Fn(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+""}function Kn(t,e,r){return e=Bn(e),function(t,e){if(e&&("object"==Nn(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,Ln()?Reflect.construct(e,r||[],Bn(t).constructor):e.apply(t,r))}function Ln(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ln=function(){return!!t})()}function Bn(t){return Bn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bn(t)}function zn(t,e){return zn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zn(t,e)}var Hn=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Kn(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&&zn(t,e)}(e,t),r=e,(n=[{key:"setup",value:function(){this.elemSlug=i()("#post_name"),this.elemTitle=i()("#title"),this.elemDescription=i()("#excerpt"),this.elemContent=i()("#content"),this.saveDraft=i()("#save-post"),this.postStatus=i()("#original_post_status"),this.assessThumbnail=this.assessThumbnail.bind(this),(0,u.addAction)("rank_math_updated_featured_image","rank-math",this.assessThumbnail),this.events()}},{key:"getContent",value:function(){if(null!==this.elemContent&&0!==this.elemContent.length)return this.isTinymce()&&tinymce.activeEditor&&!(0,o.isNull)(tinymce.get("content"))?tinymce.get("content").getContent():this.elemContent.val()}},{key:"getSlug",value:function(){var t=""===this.elemSlug.val()&&i()("#editable-post-name-full").length?i()("#editable-post-name-full").text():this.elemSlug.val();return(0,o.isUndefined)(t)?"":t}},{key:"events",value:function(){var t=this;this.elemContent.on("input change",(0,o.debounce)(function(){t.handleContentChange()},500)).trigger("change");var e=function(){t.isTinymce()&&(tinymce.activeEditor&&!(0,o.isUndefined)(tinymce.editors.content)&&tinymce.editors.content.on("keyup change",(0,o.debounce)(function(){t.handleContentChange()},500)),tinymce.editors&&!(0,o.isUndefined)(tinymce.editors.excerpt)&&tinymce.editors.excerpt.on("keyup change",(0,o.debounce)(function(){tinymce.editors.excerpt.save(),t.handleExcerptChange()},500)))};"undefined"!=typeof tinymce&&tinymce.on("AddEditor",e),i()(window).on("load",e),i()(document).on("ajaxComplete",function(e,r,n){var a="/admin-ajax.php";if(a===n.url.substr(-15)){var o="";"string"==typeof n.data&&-1!==n.data.indexOf("action=sample-permalink")&&(o=""===r.responseText?t.elemTitle.val():i()("<div>"+r.responseText+"</div>").find("#editable-post-name-full").text(),rankMathEditor.updatePermalink(o))}}),this.saveDraft.on("click",function(){t.updateBtn.attr("data-disable","true")})}},{key:"assessThumbnail",value:function(t){this.featuredImage={source_url:t.src,alt_text:t.alt},this.handleFeaturedImageChange(t)}}])&&xn(r.prototype,n),a&&xn(r,a),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,a}(Un);const Gn=Hn;function Vn(t){return Vn="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},Vn(t)}function Wn(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,$n(n.key),n)}}function $n(t){var e=function(t,e){if("object"!=Vn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Vn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Vn(e)?e:e+""}function qn(t,e,r){return e=Qn(e),function(t,e){if(e&&("object"==Vn(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,Jn()?Reflect.construct(e,r||[],Qn(t).constructor):e.apply(t,r))}function Jn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Jn=function(){return!!t})()}function Qn(t){return Qn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qn(t)}function Xn(t,e){return Xn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xn(t,e)}var Yn=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),qn(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&&Xn(t,e)}(e,t),r=e,(n=[{key:"setup",value:function(){this.updateBtn=i()('.edit-tag-actions input[type="submit"]'),this.form=i()("#edittag"),this.elemSlug=i()("#slug"),this.elemTitle=i()("#name"),this.elemDescription=i()("#rank_math_description_editor"),this.events()}},{key:"getContent",value:function(){return null===this.elemDescription||0===this.elemDescription.length?"":this.isTinymce()&&tinymce.activeEditor&&"rank_math_description_editor"===tinymce.activeEditor.id?tinymce.activeEditor.getContent():this.elemDescription.val()}},{key:"events",value:function(){var t=this;i()(window).on("load",function(){t.isTinymce()&&tinymce.activeEditor&&!(0,o.isUndefined)(tinymce.editors.rank_math_description_editor)&&tinymce.editors.rank_math_description_editor.on("keyup change",(0,o.debounce)(function(){t.handleContentChange()},500))})}}])&&Wn(r.prototype,n),a&&Wn(r,a),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,a}(Un);const Zn=Yn;function ta(t){return ta="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},ta(t)}function ea(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,ra(n.key),n)}}function ra(t){var e=function(t,e){if("object"!=ta(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ta(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ta(e)?e:e+""}function na(t,e,r){return e=ia(e),function(t,e){if(e&&("object"==ta(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,aa()?Reflect.construct(e,r||[],ia(t).constructor):e.apply(t,r))}function aa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(aa=function(){return!!t})()}function ia(t){return ia=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ia(t)}function oa(t,e){return oa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},oa(t,e)}var ua=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),na(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&&oa(t,e)}(e,t),r=e,(n=[{key:"setup",value:function(){this.updateBtn=i()("#submit"),this.form=i()("#your-profile"),this.elemSlug=i()("#user_login"),this.elemTitle=i()("#display_name"),this.elemDescription=i()("#description")}},{key:"getContent",value:function(){return this.elemDescription.val()}}])&&ea(r.prototype,n),a&&ea(r,a),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,a}(Un);const ca=ua,sa=wp.plugins,la=wp.editor;function pa(t){return pa="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},pa(t)}function fa(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 da(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?fa(Object(r),!0).forEach(function(e){ha(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fa(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function ma(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,ya(n.key),n)}}function ha(t,e,r){return(e=ya(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ya(t){var e=function(t,e){if("object"!=pa(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=pa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==pa(e)?e:e+""}var ga=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ha(this,"initialize",!1),ha(this,"isSavingRedirection",!1),ha(this,"isSavingSchemas",!1),ha(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()},(e=[{key:"lockModifiedDate",value:function(){rankMath.showLockModifiedDate&&(0,sa.registerPlugin)("rank-math-lock-last-modified",{render:function(){return wp.element.createElement(la.PluginPostStatusInfo,null,wp.element.createElement(U,null))}})}},{key:"collectGutenbergData",value:function(){return V()?(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($())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,Vr.safeDecodeURIComponent)(this._coreEditorSelect.getPermalink())}},{key:"getSlug",value:function(){var t=this.getPostAttribute("generated_slug");return"auto-draft"===t&&(t=""),(0,Vr.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,o.isUndefined)(e))return e}}},{key:"isValidMediaId",value:function(t){return"number"==typeof t&&0<t}},{key:"getPostAttribute",value:function(t){return V()?(this._coreEditorSelect||(this._coreEditorSelect=(0,c.select)("core/editor")),this._coreEditorSelect.getEditedPostAttribute(t)):""}},{key:"subscribeToGutenberg",value:function(){this.subscriber=(0,o.debounce)(this.refresh,500),(0,c.subscribe)(this.subscriber),(0,c.subscribe)(this.isSavingPost)}},{key:"refresh",value:function(){var t=da({},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,o.isEmpty)(e)||(m()({method:"POST",path:"rankmath/v1/updateMeta",data:{objectID:rankMath.objectID,objectType:rankMath.objectType,meta:e,content:(0,u.applyFilters)("rank_math_content",this.getPostAttribute("content"))}}).then(function(t){(0,u.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,o.isEmpty)(e)&&(0,c.select)("rank-math").hasSchemaUpdated()){this.isSavingSchemas=!0;var r=(0,c.select)("rank-math").getEditSchemas();m()({method:"POST",path:"rankmath/v1/updateSchemas",data:{objectID:this.getPostID(),objectType:rankMath.objectType,schemas:e}}).then(function(n){var a=da({},e),i=da({},r);(0,o.isEmpty)(n)||(0,o.map)(n,function(t,e){a["schema-"+t]=da({},a[e]),i["schema-"+t]=da({},i[e]),delete a[e],delete i[e]}),(0,c.dispatch)("rank-math").updateSchemas(a),(0,c.dispatch)("rank-math").updateEditSchemas(i),setTimeout(function(){(0,c.dispatch)("rank-math").schemaUpdated(!1),(0,u.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,o.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(),m()({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,o.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,p.__)("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,o.forEach)(r,function(r,n){e._data[n]!==t[n]&&e[r](e._data[n])}):(this.initialize=!0,(0,o.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){$()&&(t=0),(0,c.dispatch)("rank-math").updatePostID(t),(0,c.dispatch)("rank-math").toggleLoaded(!0),(0,u.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){ot.setVariable("title",t),ot.setVariable("term",t),ot.setVariable("author",t),(0,c.dispatch)("rank-math").updateSerpTitle((0,c.select)("rank-math").getTitle()),rankMathEditor.refresh("title")}},{key:"handleExcerptChange",value:function(t){ot.setVariable("excerpt",t),ot.setVariable("excerpt_only",t),ot.setVariable("wc_shortdesc",t),ot.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,u.applyFilters)("rank_math_dataCollector_data",this._data)}}])&&ma(t.prototype,e),r&&ma(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();const ba=ga;function va(t){return va="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},va(t)}function ka(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 wa(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ka(Object(r),!0).forEach(function(e){_a(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ka(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _a(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=va(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=va(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==va(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sa(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,a,i,o,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,a=t}finally{try{if(!c&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(s)throw a}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Pa(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)?Pa(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 Pa(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 Ta=function(t){var e=t.suggestions,r=t.useFocusKeyword,n=t.onCopy,a=t.onInsert,i=Sa((0,s.useState)({}),2),o=i[0],u=i[1],c=function(t){u(function(e){return wa(wa({},e),{},_a({},t,!0))}),setTimeout(function(){u(function(e){var r=wa({},e);return delete r[t],r})},1500)};return 0===e.length?wp.element.createElement("em",null,wp.element.createElement("small",null,(0,p.__)("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",u=t.post_id+"_insert",s=null;return o[i]?s=(0,p.__)("Link Copied","seo-by-rank-math"):o[u]&&(s=(0,p.__)("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(j.Button,{icon:"clipboard",className:"suggestion-copy",label:(0,p.__)("Copy Link URL to Clipboard","seo-by-rank-math"),showTooltip:!0,onClick:function(){n(t.url),c(i)}}),wp.element.createElement(j.Button,{icon:"admin-links",className:"suggestion-insert",label:(0,p.__)("Insert Link in Content","seo-by-rank-math"),showTooltip:!0,onClick:function(){a(t.url,e),c(u)}})))}))};function Da(t){return Da="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},Da(t)}function Oa(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,Ia(n.key),n)}}function Ia(t){var e=function(t,e){if("object"!=Da(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Da(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Da(e)?e:e+""}var Ea=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},ja=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)};const Aa=function(){return 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 a=r.selectionStart,i=r.selectionEnd,o=r.scrollTop;n='<a href="'+t+'">'+r.value.substring(a,i)+"</a>",a===i&&(n='<a href="'+t+'">'+e+"</a>"),r.value=r.value.substring(0,a)+n+r.value.substring(i,r.value.length),r.focus(),r.selectionStart=a+n.length,r.selectionEnd=a+n.length,r.scrollTop=o}else n='<a href="'+t+'">'+e+"</a>",r.value+=n,r.focus()}}))},(e=[{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;!1!==r&&(this._root||(this._root=(0,s.createRoot)(t)),this._root.render(wp.element.createElement(Ta,{suggestions:r||[],useFocusKeyword:n,onCopy:ja,onInsert:function(t,e){if("object"===("undefined"==typeof tinymce?"undefined":Da(tinymce))&&null!==tinymce.activeEditor&&!0!==tinymce.activeEditor.isHidden()&&"content"===tinymce.activeEditor.id){var r=tinymce.activeEditor,n=i()(r.getBody()),a=r.selection.getContent()||"";if(n.find("a[data-mce-selected]").length){var o=r.selection.getStart(),u=r.dom.getParent(o,"a[href]");if(!u){var s=r.selection.getContent({format:"raw"});if(s&&-1!==s.indexOf("</a>")){var l=s.match(/href="([^">]+)"/);l&&l[1]&&(u=r.$('a[href="'+l[1]+'"]',o)[0])&&r.selection.select(u)}}u&&(r.dom.setAttribs(u,{href:t}),i()(u).text()!==a&&r.insertContent(a))}else a.length?r.insertContent('<a href="'+t+'">'+a+"</a>"):r.insertContent('<a href="'+t+'">'+e+"</a>")}else V()&&function(t,e){var r=(0,c.select)("core/block-editor"),n='<a href="'+t+'">'+e+"</a>",a=r.getSelectedBlock();if(a&&a.attributes&&"content"in a.attributes){var i=r.getSelectionStart(),o=r.getSelectionEnd(),u=function(e,r,a){if(null!==r&&null!==a&&r!==a){var i=Ea(e,r),o=Ea(e,a),u=e.substring(i,o);return e.substring(0,i)+'<a href="'+t+'">'+u+"</a>"+e.substring(o)}if(null!==r){var c=Ea(e,r);return e.substring(0,c)+n+e.substring(c)}return e+n}(a.attributes.content||"",i?i.offset:null,o?o.offset:null);(0,c.dispatch)("core/block-editor").updateBlock(a.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}}(t,e)}})))}}}])&&Oa(t.prototype,e),r&&Oa(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Ca(t){return Ca="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},Ca(t)}function Ma(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,Ua(n.key),n)}}function Ra(t,e,r){return e&&Ma(t.prototype,e),r&&Ma(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ua(t){var e=function(t,e){if("object"!=Ca(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ca(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ca(e)?e:e+""}const Na=Ra(function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),"post"===rankMath.objectType&&!1!==rankMath.assessor.primaryTaxonomy&&i()("[data-primary-term]").each(function(){var t=i()(this),e=t.val(),r=t.data("primary-term"),n=i()("#"+r+"div"),a=i()("#"+r+"checklist"),o=a.find("li"),u=a.find('input[type="checkbox"]:checked');o.addClass("rank-math-primary-term-li"),o.find("input").each(function(){var t=i()(this);t.parent().append('<span class="rank-math-tooltip"><input class="rank-math-make-primary" value="'+t.val()+'" type="radio" name="rank_math_primary_'+r+'"><span>'+(0,p.__)("Make Term Primary","seo-by-rank-math")+"</span></span>")}),u.each(function(){var t=i()(this),r=t.closest("li");r.addClass("term-checked"),e===t.attr("value")&&(r.addClass("term-marked-primary"),r.find(">label .rank-math-make-primary").prop("checked",!0))}),n.on("click",'input[type="checkbox"]',function(){var e=i()(this).closest("li");if(e.toggleClass("term-checked"),1===a.find("li.term-checked").length||e.hasClass("term-marked-primary")&&!e.hasClass("term-checked")){var r=a.find("li.term-checked:first > label .rank-math-make-primary");0<r.length?r.trigger("click"):(o.removeClass("term-marked-primary"),o.find('input[type="radio"]').prop("checked",!1),t.val(""))}}),n.on("click",".rank-math-make-primary",function(){var e=i()(this),n=e.closest("li");o.removeClass("term-marked-primary"),n.addClass("term-marked-primary"),t.val(e.val()),wp.data.dispatch("rank-math").updatePrimaryTermID(e.val(),r)}),a.on("wpListAddEnd",function(){a.find("li:not(.rank-math-primary-term-li)").addClass("rank-math-primary-term-li term-checked").find("input").each(function(){var t=i()(this);t.parent().append('<span class="rank-math-tooltip"><input class="rank-math-make-primary" value="'+t.val()+'" type="radio" name="rank_math_primary_'+r+'"><span>'+(0,p.__)("Make Term Primary","seo-by-rank-math")+"</span></span>")})})})});function xa(t){return xa="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},xa(t)}function Fa(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,Ka(n.key),n)}}function Ka(t){var e=function(t,e){if("object"!=xa(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=xa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==xa(e)?e:e+""}const La=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.image_src="",this.image_alt="",this.getFeaturedImage(),this.setImage(),this.removeImage(),V()&&this.gutenbergImage()},(e=[{key:"setImage",value:function(){var t=this;if(!(0,o.isUndefined)(wp.media)){var e=wp.media.featuredImage.frame();e.on("select",function(){var r=i()("#rank_math_post_thumbnail"),n=e.state().get("selection").first().toJSON();t.sizeWarning(n),1>r.length&&(r=i()('<img id="rank_math_post_thumbnail" />'),i()(".facebook-thumbnail",".rank-math-social-preview-image").before(r)),"large"in n.sizes?r.attr("src",n.sizes.large.url):r.attr("src",n.sizes.full.url),t.setFeaturedImage(n)})}}},{key:"removeImage",value:function(){var t=this;i()("#postimagediv").on("click","#remove-post-thumbnail",function(){i()("#rank_math_image_warning").remove(),i()("#rank_math_post_thumbnail").remove(),t.setFeaturedImage("")})}},{key:"gutenbergImage",value:function(){var t,e,r=this;wp.data.subscribe(function(){var n=wp.data.select("core/editor").getEditedPostAttribute("featured_media");r.isValidMediaId(n)&&(t=wp.data.select("core").getMedia(n),(0,o.isUndefined)(t)||t!==e&&(e=t,r.setFeaturedImage({url:t.guid.rendered,alt:t.alt_text})))})}},{key:"setFeaturedImage",value:function(t){var e={src:(0,o.get)(t,"url",""),alt:(0,o.get)(t,"alt","")};(0,u.doAction)("rank_math_updated_featured_image",e)}},{key:"sizeWarning",value:function(t){if(i()("#rank_math_image_warning").remove(),!(200<t.width&&200<t.height)){var e=i()("#postimagediv").find(".hndle");i()('<div id="rank_math_image_warning" class="notice notice-error notice-alt"><p>'+rankMath.featuredImageNotice+"</p></div>").insertAfter(e)}}},{key:"getFeaturedImage",value:function(){var t=i()("#postimagediv img");if(!t||t.length){var e={url:t[0].src,alt:t[0].alt};this.setFeaturedImage(e)}}},{key:"isValidMediaId",value:function(t){return"number"==typeof t&&0<t}}])&&Fa(t.prototype,e),r&&Fa(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();var Ba=(0,j.createSlotFill)("RankMathAfterEditor"),za=Ba.Fill,Ha=Ba.Slot,Ga=function(t){var e=t.children,r=t.className;return wp.element.createElement(za,null,wp.element.createElement(j.PanelRow,{className:r},e))};Ga.Slot=Ha;const Va=Ga;var Wa=(0,j.createSlotFill)("RankMathAdvancedTab"),$a=Wa.Fill,qa=Wa.Slot,Ja=function(t){var e=t.children,r=t.className;return wp.element.createElement($a,null,wp.element.createElement(j.PanelRow,{className:r},e))};Ja.Slot=qa;const Qa=Ja;var Xa=(0,j.createSlotFill)("RankMathAfterFocusKeyword"),Ya=Xa.Fill,Za=Xa.Slot,ti=function(t){var e=t.children,r=t.className;return wp.element.createElement(Ya,null,wp.element.createElement("div",{className:r},e))};ti.Slot=Za;const ei=ti;function ri(t){return ri="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},ri(t)}function ni(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,ai(n.key),n)}}function ai(t){var e=function(t,e){if("object"!=ri(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ri(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ri(e)?e:e+""}var ii=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"setup",value:function(){this.registerSlots=this.registerSlots.bind(this),(0,u.addAction)("rank_math_loaded","rank-math",this.registerSlots,0),this.resultManager=new l.ResultManager,this.assessor=new G(this.getCollector()),new X,this.registerComponents=this.registerComponents.bind(this),(0,u.addAction)("rank_math_loaded","rank-math",this.registerComponents,11)}},{key:"registerSlots",value:function(){this.RankMathAfterEditor=Va,this.RankMathAfterFocusKeyword=ei,this.RankMathAdvancedTab=Qa,this.slots={AfterEditor:Va,AfterFocusKeyword:ei,AdvancedTab:Qa}}},{key:"registerComponents",value:function(){this.components={},this.components.linkSuggestions=new Aa,this.components.primaryTerm=new Na,this.components.featuredImage=new La,rankMathAdmin.variableInserter(!1),setTimeout(function(){(0,s.createRoot)(document.getElementById("rank-math-metabox-wrapper")).render((0,s.createElement)((0,u.applyFilters)("rank_math_app",{})))},1e3)}},{key:"refresh",value:function(t){this.assessor.refresh(t)}},{key:"updatePermalink",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.assessor.dataCollector.handleSlugChange(t,e),(0,c.dispatch)("rank-math").updatePermalink(t)}},{key:"updatePermalinkSanitize",value:function(t){t=this.assessor.getResearch("slugify")(t),(0,c.dispatch)("rank-math").updatePermalink(t)}},{key:"getPrimaryKeyword",value:function(){return I(this.assessor.getPrimaryKeyword())}},{key:"getSelectedKeyword",value:function(){var t=this.assessor.getSelectedKeyword();return(0,o.isUndefined)(t)?"":I(t)}},{key:"getCollector",value:function(){return"post"===rankMath.objectType?V()?new ba:new Gn(this):"term"===rankMath.objectType?new Zn:"user"===rankMath.objectType?new ca:void 0}}],e&&ni(t.prototype,e),r&&ni(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();i()(function(){window.rankMathEditor=new ii,window.rankMathEditor.setup(),window.RankMathApp=new rt}),i()(window).on("load",function(){i().when(i().ready).then(function(){(0,u.doAction)("rank_math_loaded")})})}();
保存
返回