!function(){"use strict";var e={n:function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},d:function(t,n){for(var a in n)e.o(n,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:n[a]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=jQuery,n=e.n(t),a=lodash,o=wp.i18n,r=wp.components,i=wp.element;function l(e){return l="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},l(e)}function u(e,t){for(var n=0;n .wp-submenu");t.length&&t.find("> .wp-submenu > li").length!==a.children("li").length&&a.fadeOut(200,(function(){a.html(t.find("> .wp-submenu").hide().children()).fadeIn(400)}))}})),n()(".rank-math-modules").each((function(){var e=n()(this),t=e.data("depmodules");if("object"===l(t)&&t.length){var a=t.filter((function(e){return!n()("#module-"+e).is(":checked")})).length>0;e.prop("disabled",a),a?e.closest(".rank-math-box").removeClass("active"):e.is(":checked")&&e.closest(".rank-math-box").addClass("active")}}))):window.alert("Something went wrong! Please try again.")}))}))}},{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(e){e.preventDefault();var t=n()(this).data("mode");return n().ajax({url:rankMath.api.root+"rankmath/v1/updateMode",method:"POST",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",rankMath.api.nonce)},data:{mode:t}}).done((function(e){e?window.location.reload():window.alert("Something went wrong! Please try again.")})),!1}))}},{key:"dashboardWidget",value:function(){var e=n()("#rank-math-dashboard-widget");e.length&&n().ajax({url:rankMath.api.root+"rankmath/v1/dashboardWidget",method:"GET",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",rankMath.api.nonce)}}).done((function(t){t?e.removeClass("rank-math-loading").html(t):e.removeClass("rank-math-loading").html((0,o.__)("Something went wrong! Please try again.","rank-math"))}))}},{key:"onsiteCheckout",value:function(){n()(".pro-link").on("click",(function(e){var t=n()(this).data("url");if(void 0!==t&&""!==t)return e.preventDefault(),(0,a.isNull)(document.getElementById("rank-math-onsite-checkout-wrapper"))?(n()("body").append('
'),setTimeout((function(){(0,i.render)(wp.element.createElement(r.Modal,{className:"rank-math-onsite-checkout-modal",onRequestClose:function(e){if(!(0,a.isUndefined)(e)&&(0,a.includes)(e.target.classList,"rank-math-onsite-checkout-modal"))return!1;n()(".components-modal__screen-overlay").hide(),n()("body").removeClass("modal-open")},shouldCloseOnClickOutside:!0},wp.element.createElement("iframe",{width:"100%",height:"100%",src:t})),document.getElementById("rank-math-onsite-checkout-wrapper"))}),100),!1):(n()(".components-modal__screen-overlay").show(),!1)}))}}])&&u(t.prototype,c),d&&u(t,d),Object.defineProperty(t,"prototype",{writable:!1}),e}();n()((function(){new c}))}();