|
1
|
|
-!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=239)}({1:function(e,t){e.exports=window.wp.element},10:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},11:function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},121:function(e,t,n){"use strict";n.d(t,"a",(function(){return x}));var r=n(11),o=n.n(r),s=n(10),i=n.n(s),a=n(20),c=n.n(a),u=n(21),l=n.n(u),p=n(13),d=n.n(p),f=n(95);var x=function(e){c()(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d()(t);if(n){var o=d()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return l()(this,e)});function s(e,t,n,o,a){var c;return i()(this,s),(c=r.call(this,e)).name="RequestError",c.url=t,c.method=n,c.statusCode=o,c.stackTrace=a,c}return o()(s)}(n.n(f)()(Error))},13:function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},14:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},153:function(e,t,n){"use strict";n.d(t,"a",(function(){return x}));var r=n(11),o=n.n(r),s=n(10),i=n.n(s),a=n(20),c=n.n(a),u=n(21),l=n.n(u),p=n(13),d=n.n(p),f=n(95);var x=function(e){c()(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d()(t);if(n){var o=d()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return l()(this,e)});function s(e,t){var n;return i()(this,s),(n=r.call(this,e)).name="ParseError",n.parseString=t,n}return o()(s)}(n.n(f)()(Error))},16:function(e,t){function n(e,t,n,r,o,s,i){try{var a=e[s](i),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(o,s){var i=e.apply(t,r);function a(e){n(i,o,s,a,c,"next",e)}function c(e){n(i,o,s,a,c,"throw",e)}a(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},165:function(e,t,n){"use strict";function r(e,t){var n=new URL(e);return n.searchParams.delete(t),n.href}function o(e,t,n){window.history.pushState(e,t,n)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},174:function(e,t){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")},e.exports.__esModule=!0,e.exports.default=e.exports},175:function(e,t,n){var r=n(58),o=n(176);function s(t,n,i){return o()?(e.exports=s=Reflect.construct,e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=s=function(e,t,n){var o=[null];o.push.apply(o,t);var s=new(Function.bind.apply(e,o));return n&&r(s,n.prototype),s},e.exports.__esModule=!0,e.exports.default=e.exports),s.apply(null,arguments)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},176:function(e,t){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},18:function(e,t){e.exports=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))},e.exports.__esModule=!0,e.exports.default=e.exports},2:function(e,t){e.exports=window.yoast.propTypes},20:function(e,t,n){var r=n(58);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},21:function(e,t,n){var r=n(41).default,o=n(14);e.exports=function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},239:function(e,t,n){"use strict";n.r(t);var r,o,s=n(1),i=n(25),a=n.n(i),c=n(16),u=n.n(c),l=n(10),p=n.n(l),d=n(11),f=n.n(d),x=n(14),y=n.n(x),h=n(20),b=n.n(h),g=n(21),m=n.n(g),v=n(13),w=n.n(v),_=n(8),O=n.n(_),j=n(3),E=n(5),S=n(30),k=n(2),I=n.n(k),P=n(165),R=n(18),A=n.n(R),T=n(121),M=n(6),B=n.n(M),C=B.a.div(r||(r=A()(["\n\tmargin-top: 8px;\n"]))),q=B.a.pre(o||(o=A()(["\n\toverflow-x: scroll;\n\tmax-width: 500px;\n\tborder: 1px solid;\n\tpadding: 16px;\n"])));function D(e){var t=e.title,n=e.value;return n?Object(s.createElement)("p",null,Object(s.createElement)("strong",null,t),Object(s.createElement)("br",null),n):null}function N(e){var t=e.title,n=e.value;return n?Object(s.createElement)("details",null,Object(s.createElement)("summary",null,t),Object(s.createElement)(q,null,n)):null}function z(e){var t=e.message,n=e.error;return Object(s.createElement)(E.Alert,{type:"error"},Object(s.createElement)("div",{dangerouslySetInnerHTML:{__html:t}}),Object(s.createElement)("details",null,Object(s.createElement)("summary",null,Object(j.__)("Error details","wordpress-seo")),Object(s.createElement)(C,null,Object(s.createElement)(D,{title:Object(j.__)("Request URL","wordpress-seo"),value:n.url}),Object(s.createElement)(D,{title:Object(j.__)("Request method","wordpress-seo"),value:n.method}),Object(s.createElement)(D,{title:Object(j.__)("Status code","wordpress-seo"),value:n.statusCode}),Object(s.createElement)(D,{title:Object(j.__)("Error message","wordpress-seo"),value:n.message}),Object(s.createElement)(N,{title:Object(j.__)("Response","wordpress-seo"),value:n.parseString}),Object(s.createElement)(N,{title:Object(j.__)("Error stack trace","wordpress-seo"),value:n.stackTrace}))))}D.propTypes={title:I.a.string.isRequired,value:I.a.any},D.defaultProps={value:""},N.propTypes={title:I.a.string.isRequired,value:I.a.string},N.defaultProps={value:""},z.propTypes={message:I.a.string.isRequired,error:I.a.oneOfType([I.a.instanceOf(Error),I.a.instanceOf(T.a)]).isRequired};var F=n(153);var L=function(e){b()(x,e);var t,n,r,o,i,a,c,l,d=(c=x,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=w()(c);if(l){var n=w()(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return m()(this,e)});function x(e){var t;return p()(this,x),(t=d.call(this,e)).settings=yoastIndexingData,t.state={state:"idle",processed:0,error:null,amount:parseInt(t.settings.amount,10),firstTime:"1"===t.settings.firstTime},t.startIndexing=t.startIndexing.bind(y()(t)),t.stopIndexing=t.stopIndexing.bind(y()(t)),t}return f()(x,[{key:"doIndexingRequest",value:(a=u()(O.a.mark((function e(t,n){var r,o,s,i;return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t,{method:"POST",headers:{"X-WP-Nonce":n}});case 2:return r=e.sent,e.next=5,r.text();case 5:o=e.sent,e.prev=6,s=JSON.parse(o),e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(6),new F.a("Error parsing the response to JSON.",o);case 13:if(r.ok){e.next=16;break}throw i=s.data?s.data.stackTrace:"",new T.a(s.message,t,"POST",r.status,i);case 16:return e.abrupt("return",s);case 17:case"end":return e.stop()}}),e,null,[[6,10]])}))),function(_x,e){return a.apply(this,arguments)})},{key:"doPreIndexingAction",value:(i=u()(O.a.mark((function e(t){return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof this.props.preIndexingActions[t]){e.next=3;break}return e.next=3,this.props.preIndexingActions[t](this.settings);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"doPostIndexingAction",value:(o=u()(O.a.mark((function e(t,n){return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof this.props.indexingActions[t]){e.next=3;break}return e.next=3,this.props.indexingActions[t](n.objects,this.settings);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"doIndexing",value:(r=u()(O.a.mark((function e(t){var n,r=this;return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this.settings.restApi.root+this.settings.restApi.indexing_endpoints[t];case 1:if(!this.isState("in_progress")||!1===n){e.next=11;break}return e.prev=2,e.delegateYield(O.a.mark((function e(){var o;return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.doPreIndexingAction(t);case 2:return e.next=4,r.doIndexingRequest(n,r.settings.restApi.nonce);case 4:return o=e.sent,e.next=7,r.doPostIndexingAction(t,o);case 7:r.setState((function(e){return{processed:e.processed+o.objects.length,firstTime:!1}})),n=o.next_url;case 9:case"end":return e.stop()}}),e)}))(),"t0",4);case 4:e.next=9;break;case 6:e.prev=6,e.t1=e.catch(2),this.setState({state:"errored",error:e.t1,firstTime:!1});case 9:e.next=1;break;case 11:case"end":return e.stop()}}),e,this,[[2,6]])}))),function(e){return r.apply(this,arguments)})},{key:"index",value:(n=u()(O.a.mark((function e(){var t,n,r;return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0,n=Object.keys(this.settings.restApi.indexing_endpoints);case 1:if(!(t<n.length)){e.next=8;break}return r=n[t],e.next=5,this.doIndexing(r);case 5:t++,e.next=1;break;case 8:this.isState("errored")||this.isState("idle")||this.completeIndexing();case 9:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"startIndexing",value:(t=u()(O.a.mark((function e(){return O.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({processed:0,state:"in_progress"},this.index);case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"completeIndexing",value:function(){this.setState({state:"completed"})}},{key:"stopIndexing",value:function(){this.setState((function(e){return{state:"idle",processed:0,amount:e.amount-e.processed}}))}},{key:"componentDidMount",value:function(){if(!this.settings.disabled&&(this.props.indexingStateCallback(0===this.state.amount?"completed":this.state.state),"true"===new URLSearchParams(window.location.search).get("start-indexation"))){var e=Object(P.b)(window.location.href,"start-indexation");Object(P.a)(null,document.title,e),this.startIndexing()}}},{key:"componentDidUpdate",value:function(e,t){this.state.state!==t.state&&this.props.indexingStateCallback(this.state.state)}},{key:"isState",value:function(e){return this.state.state===e}},{key:"renderFirstIndexationNotice",value:function(){return Object(s.createElement)(E.Alert,{type:"info"},Object(j.__)("This feature includes and replaces the Text Link Counter and Internal Linking Analysis","wordpress-seo"))}},{key:"renderStartButton",value:function(){return Object(s.createElement)(E.NewButton,{variant:"primary",onClick:this.startIndexing},Object(j.__)("Start SEO data optimization","wordpress-seo"))}},{key:"renderStopButton",value:function(){return Object(s.createElement)(E.NewButton,{variant:"secondary",onClick:this.stopIndexing},Object(j.__)("Stop SEO data optimization","wordpress-seo"))}},{key:"renderDisabledTool",value:function(){return Object(s.createElement)(s.Fragment,null,Object(s.createElement)("p",null,Object(s.createElement)(E.NewButton,{variant:"secondary",disabled:!0},Object(j.__)("Start SEO data optimization","wordpress-seo"))),Object(s.createElement)(E.Alert,{type:"info"},Object(j.__)("SEO data optimization is disabled for non-production environments.","wordpress-seo")))}},{key:"renderProgressBar",value:function(){return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(E.ProgressBar,{style:{height:"16px",margin:"8px 0"},progressColor:S.colors.$color_pink_dark,max:parseInt(this.state.amount,10),value:this.state.processed}),Object(s.createElement)("p",{style:{color:S.colors.$palette_grey_text}},Object(j.__)("Optimizing SEO data... This may take a while.","wordpress-seo")))}},{key:"renderErrorAlert",value:function(){return Object(s.createElement)(z,{message:yoastIndexingData.errorMessage,error:this.state.error})}},{key:"renderTool",value:function(){return Object(s.createElement)(s.Fragment,null,this.isState("in_progress")&&this.renderProgressBar(),this.isState("errored")&&this.renderErrorAlert(),this.isState("idle")&&this.state.firstTime&&this.renderFirstIndexationNotice(),this.isState("in_progress")?this.renderStopButton():this.renderStartButton())}},{key:"render",value:function(){return this.settings.disabled?this.renderDisabledTool():this.isState("completed")||0===this.state.amount?Object(s.createElement)(E.Alert,{type:"success"},Object(j.__)("SEO data optimization complete","wordpress-seo")):this.renderTool()}}]),x}(s.Component);L.propTypes={indexingActions:I.a.object,preIndexingActions:I.a.object,indexingStateCallback:I.a.func},L.defaultProps={indexingActions:{},preIndexingActions:{},indexingStateCallback:function(){}};var U,J=L,$={},G={};function H(){U||(U=document.getElementById("yoast-seo-indexing-action")),U&&Object(s.render)(Object(s.createElement)(J,{preIndexingActions:$,indexingActions:G}),U)}window.yoast=window.yoast||{},window.yoast.indexing=window.yoast.indexing||{},window.yoast.indexing.registerPreIndexingAction=function(e,t){$[e]=t,H()},window.yoast.indexing.registerIndexingAction=function(e,t){G[e]=t,H()},window.yoast.indexation=window.yoast.indexing,window.yoast.indexation.registerPreIndexationAction=function(e,t){console.warn("Deprecated since 15.1. Use 'window.yoast.indexing.registerPreIndexingAction' instead."),window.yoast.indexing.registerPreIndexingAction(e,t)},window.yoast.indexation.registerIndexationAction=function(e,t){console.warn("Deprecated since 15.1. Use 'window.yoast.indexing.registerIndexingAction' instead."),window.yoast.indexing.registerIndexingAction(e,t)},a()((function(){H()}))},25:function(e,t){e.exports=window.jQuery},3:function(e,t){e.exports=window.wp.i18n},30:function(e,t){e.exports=window.yoast.styleGuide},41:function(e,t){function n(t){return e.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},5:function(e,t){e.exports=window.yoast.componentsNew},58:function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t,r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},6:function(e,t){e.exports=window.yoast.styledComponents},8:function(e,t){e.exports=window.regeneratorRuntime},95:function(e,t,n){var r=n(13),o=n(58),s=n(174),i=n(175);function a(t){var n="function"==typeof Map?new Map:void 0;return e.exports=a=function(e){if(null===e||!s(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return i(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,a(t)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}}); |
|
1
|
+(()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.element,s=window.jQuery;var n=e.n(s);const i=window.wp.i18n,r=window.yoast.componentsNew,o=window.yoast.styleGuide,a=window.yoast.propTypes;var d=e.n(a);class c extends Error{constructor(e,t,s,n,i,r={}){var o,a;super(e),this.name="RequestError",this.url=t,this.method=s,this.statusCode=n,this.stackTrace=i,this.objectId=null!==(o=r.objectId)&&void 0!==o?o:null,this.objectType=null!==(a=r.objectType)&&void 0!==a?a:null}}class p extends Error{constructor(e,t){super(e),this.name="ParseError",this.parseString=t}}const l="idle",h="in_progress",u="errored",g="completed";class x extends t.Component{constructor(e){super(e),this.settings=yoastIndexingData,this.state={state:l,processed:0,error:null,amount:parseInt(this.settings.amount,10),firstTime:"1"===this.settings.firstTime},this.startIndexing=this.startIndexing.bind(this),this.stopIndexing=this.stopIndexing.bind(this)}getAlreadyIndexedStateName(){return"completed"}async doIndexingRequest(e,t){const s=await fetch(e,{method:"POST",headers:{"X-WP-Nonce":t}}),n=await s.text();let i;try{i=JSON.parse(n)}catch(e){throw new p("Error parsing the response to JSON.",n)}if(!s.ok){const t=i.data||{};throw new c(i.message,e,"POST",s.status,t.stackTrace,{objectId:t.object_id,objectType:t.object_type})}return i}async doPreIndexingAction(e){"function"==typeof this.props.preIndexingActions[e]&&await this.props.preIndexingActions[e](this.settings)}async doPostIndexingAction(e,t){"function"==typeof this.props.indexingActions[e]&&await this.props.indexingActions[e](t.objects,this.settings)}detectIndexingLoop(e,t,s,n){if(s.next_url!==t||0===s.objects.length)return null;const i=JSON.stringify(s.objects.map(e=>[e.id,e.object_type,e.object_sub_type,e.object_id]));if(i===n)throw new Error(`Optimization of the '${e}' data is not making progress: the same batch was returned twice. Stopped to prevent an endless loop. This can happen when a plugin conflict or a failing script prevents the returned objects from being processed.`);return i}async doIndexing(e){let s=this.settings.restApi.root+this.settings.restApi.indexing_endpoints[e],n=null;for(;this.isState(h)&&!1!==s;)try{await this.doPreIndexingAction(e);const i=await this.doIndexingRequest(s,this.settings.restApi.nonce);await this.doPostIndexingAction(e,i),n=this.detectIndexingLoop(e,s,i,n),(0,t.flushSync)(()=>{this.setState(e=>({processed:e.processed+i.objects.length,firstTime:!1}))}),s=i.next_url}catch(e){(0,t.flushSync)(()=>{this.setState({state:u,error:e,firstTime:!1})})}}async index(){for(const e of Object.keys(this.settings.restApi.indexing_endpoints))await this.doIndexing(e);this.isState(u)||this.isState(l)||this.completeIndexing()}async startIndexing(){this.setState({processed:0,state:h},this.index)}completeIndexing(){this.setState({state:g})}stopIndexing(){this.setState(e=>({state:l,processed:0,amount:e.amount-e.processed}))}componentDidMount(){var e,t;if(!this.settings.disabled&&(this.props.indexingStateCallback(0===this.state.amount?this.getAlreadyIndexedStateName():this.state.state),"true"===new URLSearchParams(window.location.search).get("start-indexation"))){const s=function(e){const t=new URL(e);return t.searchParams.delete("start-indexation"),t.href}(window.location.href);e=document.title,t=s,window.history.pushState(null,e,t),this.startIndexing()}}componentDidUpdate(e,t){this.state.state!==t.state&&this.props.indexingStateCallback(this.state.state)}isState(e){return this.state.state===e}}const w={indexingActions:d().object,preIndexingActions:d().object,indexingStateCallback:d().func},y={indexingActions:{},preIndexingActions:{},indexingStateCallback:()=>{}};x.propTypes=w,x.defaultProps=y;const m=x,j=window.yoast.helpers,f=window.ReactJSXRuntime,{stripTagsFromHtmlString:S}=j.strings,_=["a","p"];function I({title:e,value:t=""}){return t?(0,f.jsxs)("p",{children:[(0,f.jsx)("strong",{children:e}),(0,f.jsx)("br",{}),t]}):null}function b({title:e,value:t=""}){return t?(0,f.jsxs)("details",{children:[(0,f.jsx)("summary",{children:e}),(0,f.jsx)("pre",{style:{overflowX:"scroll",maxWidth:"500px",border:"1px solid",padding:"16px"},children:t})]}):null}function T({message:e,error:t}){let s="";return t.objectType&&(s=t.objectId?`${t.objectType} #${t.objectId}`:t.objectType),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{dangerouslySetInnerHTML:{__html:S(e,_)}}),(0,f.jsxs)("details",{children:[(0,f.jsx)("summary",{children:(0,i.__)("Error details","wordpress-seo")}),(0,f.jsxs)("div",{style:{marginTop:"8px"},children:[(0,f.jsx)(I,{title:(0,i.__)("Failing object","wordpress-seo"),value:s}),(0,f.jsx)(I,{title:(0,i.__)("Request URL","wordpress-seo"),value:t.url}),(0,f.jsx)(I,{title:(0,i.__)("Request method","wordpress-seo"),value:t.method}),(0,f.jsx)(I,{title:(0,i.__)("Status code","wordpress-seo"),value:t.statusCode}),(0,f.jsx)(I,{title:(0,i.__)("Error message","wordpress-seo"),value:t.message}),(0,f.jsx)(b,{title:(0,i.__)("Response","wordpress-seo"),value:t.parseString}),(0,f.jsx)(b,{title:(0,i.__)("Error stack trace","wordpress-seo"),value:t.stackTrace})]})]})]})}function A({message:e,error:t}){return(0,f.jsx)(r.Alert,{type:"error",children:(0,f.jsx)(T,{message:e,error:t})})}I.propTypes={title:d().string.isRequired,value:d().any},b.propTypes={title:d().string.isRequired,value:d().string},T.propTypes={message:d().string.isRequired,error:d().oneOfType([d().instanceOf(Error),d().instanceOf(c)]).isRequired},A.propTypes={message:d().string.isRequired,error:d().oneOfType([d().instanceOf(Error),d().instanceOf(c)]).isRequired};class v extends m{renderFirstIndexationNotice(){return(0,f.jsx)(r.Alert,{type:"info",children:(0,i.__)("This feature includes and replaces the Text Link Counter and Internal Linking Analysis","wordpress-seo")})}renderStartButton(){return(0,f.jsx)(r.NewButton,{variant:"primary",onClick:this.startIndexing,children:(0,i.__)("Start SEO data optimization","wordpress-seo")})}renderStopButton(){return(0,f.jsx)(r.NewButton,{variant:"secondary",onClick:this.stopIndexing,children:(0,i.__)("Stop SEO data optimization","wordpress-seo")})}renderDisabledTool(){return(0,f.jsxs)(t.Fragment,{children:[(0,f.jsx)("p",{children:(0,f.jsx)(r.NewButton,{variant:"secondary",disabled:!0,children:(0,i.__)("Start SEO data optimization","wordpress-seo")})}),(0,f.jsx)(r.Alert,{type:"info",children:(0,i.__)("SEO data optimization is disabled for non-production environments.","wordpress-seo")})]})}renderProgressBar(){return(0,f.jsxs)(t.Fragment,{children:[(0,f.jsx)(r.ProgressBar,{style:{height:"16px",margin:"8px 0"},progressColor:o.colors.$color_pink_dark,max:parseInt(this.state.amount,10),value:this.state.processed}),(0,f.jsx)("p",{style:{color:o.colors.$palette_grey_text},children:(0,i.__)("Optimizing SEO data… This may take a while.","wordpress-seo")})]})}renderErrorAlert(){return(0,f.jsx)(A,{message:yoastIndexingData.errorMessage,error:this.state.error})}renderTool(){return(0,f.jsxs)(t.Fragment,{children:[this.isState(h)&&this.renderProgressBar(),this.isState(u)&&this.renderErrorAlert(),this.isState(l)&&this.state.firstTime&&this.renderFirstIndexationNotice(),this.isState(h)?this.renderStopButton():this.renderStartButton()]})}render(){return this.settings.disabled?this.renderDisabledTool():this.isState(g)||0===this.state.amount?(0,f.jsx)(r.Alert,{type:"success",children:(0,i.__)("SEO data optimization complete","wordpress-seo")}):this.renderTool()}}v.propTypes=w,v.defaultProps=y;const O=v;let E;function P(){var e;null===(e=E)||void 0===e||e.render((0,f.jsx)(O,{preIndexingActions:window.yoast.indexing.preIndexingActions,indexingActions:window.yoast.indexing.indexingActions}))}window.yoast=window.yoast||{},window.yoast.indexing=window.yoast.indexing||{},window.yoast.indexing.preIndexingActions={},window.yoast.indexing.indexingActions={},window.yoast.indexing.helpers={doAjaxRequest:function(e,t,s,n){return new Promise((i,r)=>{jQuery.ajax({type:e,url:t,beforeSend:s?e=>{e.setRequestHeader("X-WP-Nonce",s)}:null,data:n,dataType:"json",success:i,error:r})})}},window.yoast.indexing.registerPreIndexingAction=(e,t)=>{window.yoast.indexing.preIndexingActions[e]=t,P()},window.yoast.indexing.registerIndexingAction=(e,t)=>{window.yoast.indexing.indexingActions[e]=t,P()},n()(function(){const e=document.getElementById("yoast-seo-indexing-action");e&&(E=(0,t.createRoot)(e)),P()})})(); |