text: 'use strict';window.tsfinstaller=function(a){var b=a(document),c=function(g){wp.updates.addAdminNotice({id:'install-success',className:'notice-success is-dismissible',message:wp.updates.l10n.installedMsg.replace('%s',g.activateUrl+'&from=plugins')}),a('[data-slug="'+g.slug+'"]').removeClass('install-now updating-message').addClass('activate-now').attr({href:g.activateUrl+'&from=plugins','aria-label':wp.updates.l10n.activatePluginLabel.replace('%s',g.pluginName)}).text(wp.updates.l10n.activatePlugin),wp.a11y.speak(wp.updates.l10n.installedMsg,'polite'),b.trigger('tsf-tsfem-install-success',g)},d=function(g){var h=wp.updates.l10n.installFailed.replace('%s',g.errorMessage),i=a('[data-slug="'+g.slug+'"]'),j=i.data('name');!wp.updates.isValidResponse(g,'install')||wp.updates.maybeHandleCredentialError(g,'install-plugin')||(wp.updates.addAdminNotice({id:g.errorCode,className:'notice-error is-dismissible',message:h}),i.removeClass('updating-message').text(wp.updates.l10n.installNow).attr('aria-label',wp.updates.l10n.pluginInstallNowLabel.replace('%s',j)),wp.a11y.speak(h,'assertive'),b.trigger('tsf-tsfem-install-error',g))},f=function(){if(wp&&wp.updates){var h=wp.updates._addCallbacks;a('#plugin_install_from_iframe').on('click',function(i){var k,j=window.parent===window?null:window.parent;-1!==window.parent.location.pathname.indexOf('index.php')&&a(this).data('slug')===tsfinstallerL10n.slug&&(a.support.postMessage=!!window.postMessage,!1===a.support.postMessage||null===j||(i.preventDefault(),k={action:'install-plugin',data:{slug:a(this).data('slug')}},j.postMessage(JSON.stringify(k),window.location.origin)))}),a('#tsf-tsfem-tb').on('click',function(){var j=!1;wp.updates._addCallbacks=function(p,q){if('install-plugin'===q&&tsfinstallerL10n.slug===p.slug){p.success=c,p.error=d;var r=a('[data-slug="'+p.slug+'"]');r.addClass('updating-message').attr('aria-label',wp.updates.l10n.pluginInstallingLabel.replace('%s',r.data('name'))).text(wp.updates.l10n.installing),j=!0}return p},a(window).on('message',function(p){var q;try{q=a.parseJSON(p.originalEvent.data)}catch(r){return}q&&'undefined'!=typeof q.action&&('install-plugin'===q.action?j=!1:j=!0)});var k,l,m=function(){wp.updates._addCallbacks=h,clearInterval(k),b.off(l,m)},n=function(){};l='wp-plugin-installing wp-plugin-install-error wp-plugin-install-success',a('body').one('thickbox:removed',function o(){k=setInterval(n,100),setTimeout(m,750)}),b.one(l,m)}),b.on('click','#tsf-tsfem-install',function(i){var j=a(i.target);j.hasClass('activate-now')||(i.preventDefault(),j.hasClass('updating-message')||j.hasClass('button-disabled')||(j.html()!==wp.updates.l10n.installing&&j.data('originaltext',j.html()),j.addClass('updating-message').attr('aria-label',wp.updates.l10n.pluginInstallingLabel.replace('%s',j.data('name'))).text(wp.updates.l10n.installing),wp.updates.shouldRequestFilesystemCredentials&&!wp.updates.ajaxLocked&&(wp.updates.requestFilesystemCredentials(i),b.on('credential-modal-cancel',function(){j.removeClass('updating-message').text(wp.updates.l10n.installNow).attr('aria-label',wp.updates.l10n.installNowLabel.replace('%s',j.data('name'))),wp.a11y.speak(wp.updates.l10n.updateCancel,'polite')})),wp.updates.installPlugin({slug:j.data('slug'),pagenow:pagenow,success:c,error:d})))})}};return{load:function load(){tsfinstallerL10n.canEnhance&&a(document.body).ready(f)}}}(jQuery),jQuery(window.tsfinstaller.load);
  