!function(e){"use strict";window.pluginCount=tmpcoder_localize.pluginCount,window.pluginSucessCount=tmpcoder_localize.pluginSucessCount,window.pluginsList=tmpcoder_localize.pluginsList,window.pluginsListFile=tmpcoder_localize.pluginsListFile,window.pluginNotInstallCount=tmpcoder_localize.pluginNotInstallCount,window.installedPluginNotActivated=tmpcoder_localize.installedPluginNotActivated,e(document).on("click",".tmpcoder-notice .notice-dismiss",function(){jQuery.post(tmpcoder_localize.ajaxUrl,{action:"tmpcoder_dismissed_handler",notice:e(this).closest(".tmpcoder-notice").data("notice")}),e(".tmpcoder-notice").hide()}),e(document).on("wp-plugin-install-success",function(t,n){t.preventDefault(),window.pluginSucessCount++,console.log("pluginSucessCount",window.pluginSucessCount),console.log("pluginCount",window.pluginCount),tmpcoder_localize.recommendedPluiginActivatingText,tmpcoder_localize.tmpcoderSitesLink;var i=tmpcoder_localize.tmpcoderPluginManagerNonce,a=jQuery(t.target),s=["elementor/elementor.php","sastra-essential-addons-for-elementor/sastra-essential-addons-for-elementor.php","redux-framework/redux-framework.php"];(window.pluginSucessCount==window.pluginCount||window.pluginSucessCount==window.pluginNotInstallCount)&&setTimeout(function(){e.ajax({url:tmpcoder_localize.ajaxUrl,type:"POST",data:{action:"tmpcoder_recommended_plugin_activate",security:i,init:s}}).done(function(e){console.error(e),e.success?(a.removeClass("tmpcoder-activate-recommended-plugin tmpcoder-install-recommended-plugin button button-primary install-now activate-now updating-message"),a.parent(".tmpcoder-addon-link-wrapper").parent(".tmpcoder-recommended-plugin").addClass("active"),window.location.href=tmpcoder_localize.tmpcoderRedirectionLink):a.removeClass("updating-message")})},1200)}),e(document).on("click",".tmpcoder-notice .button-primary",function(t){if(console.log("pluginsList:",window.pluginsList),"install-activate"===e(this).data("action")&&!e(this).hasClass("init")){var n=e(this),i=jQuery(t.target),a=jQuery(document);if(n.attr("href"),n.addClass("init"),n.html('Installing Templates Kit Library <span class="dot-flashing"></span>'),!(i.hasClass("updating-message")||i.hasClass("button-disabled"))){if(wp.updates.shouldRequestFilesystemCredentials&&!wp.updates.ajaxLocked&&(wp.updates.requestFilesystemCredentials(t),a.on("credential-modal-cancel",function(){e(".tmpcoder-install-recommended-plugin.updating-message").addClass("tmpcoder-activate-recommended-plugin").removeClass("updating-message tmpcoder-install-recommended-plugin").text(wp.updates.l10n.installNow),wp.a11y.speak(wp.updates.l10n.updateCancel,"polite")})),window.pluginsList.length>0){var s=window.pluginsList;e.each(s,function(e,t){wp.updates.queue.push({action:"install-plugin",data:{slug:t}})}),wp.updates.queueChecker()}else{var l=tmpcoder_localize.tmpcoderPluginManagerNonce;e.ajax({url:tmpcoder_localize.ajaxUrl,type:"POST",data:{action:"tmpcoder_recommended_plugin_activate",security:l,init:window.installedPluginNotActivated}}).done(function(e){e.success&&(window.location.href=tmpcoder_localize.tmpcoderRedirectionLink)})}t.preventDefault()}}}),e(document).on("tmpcoder-after-plugin-active",function(e,t,n){e.preventDefault(),(n.indexOf("elementor")>=0||n.indexOf("jeg-elementor-kit")>=0)&&(window.location.href=t+"&tmpcoder-disable-activation-notice")})}(jQuery);