!function(){"use strict";var t={n:function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,{a:n}),n},d:function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}};const e=jQuery;var n=t.n(e);const r=wp.i18n;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 o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,i(r.key),r)}}function i(t){var e=function(t,e){if("object"!=a(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==a(e)?e:e+""}var u=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.deactivatePlugins(),this.initializeClipBoard(),this.modeSelector(),this.dashboardWidget()},e=[{key:"deactivatePlugins",value:function(){n()(".dashboard-deactivate-plugin").on("click",function(t){t.preventDefault();var e=n()(this);return n().ajax({url:window.ajaxurl,type:"POST",data:{action:"rank_math_deactivate_plugins",security:rankMath.security,plugin:"all"}}).always(function(t){"1"===t&&e.parents(".rank-math-notice").remove()}),!1})}},{key:"initializeClipBoard",value:function(){"undefined"!=typeof ClipboardJS&&(n()(".get-debug-report").on("click",function(){return n()("#debug-report").slideDown(),n()("#debug-report textarea").trigger("focus").trigger("select"),n()(this).parent().fadeOut(),!1}),new ClipboardJS("#copy-for-support"))}},{key:"modeSelector",value:function(){n()(".rank-math-mode-selector a").on("click",function(t){t.preventDefault();var e=n()(this).data("mode");return n().ajax({url:rankMath.api.root+"rankmath/v1/updateMode",method:"POST",beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",rankMath.api.nonce)},data:{mode:e}}).done(function(t){t?window.location.reload():window.alert((0,r.__)("Something went wrong! Please try again.","rank-math"))}),!1})}},{key:"dashboardWidget",value:function(){var t=n()("#rank-math-dashboard-widget");t.length&&n().ajax({url:rankMath.api.root+"rankmath/v1/dashboardWidget",method:"GET",beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",rankMath.api.nonce)}}).done(function(e){e?t.removeClass("rank-math-loading").html(e):t.removeClass("rank-math-loading").html((0,r.__)("Something went wrong! Please try again.","rank-math"))})}}],e&&o(t.prototype,e),a&&o(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,a}();n()(function(){new u})}();