jQuery(document).ready(function(l){vare,a,t,s,i,r=wp.i18n.__,n=wp.i18n._n,c=wp.i18n.sprintf,h=newClipboardJS(".site-health-copy-buttons .copy-button"),u=l(".health-check-body.health-check-debug-tab").length,o=l("#health-check-accordion-block-wp-paths-sizes");functiond(e){vart,s,a=wp.template("health-check-issue"),i=l("#health-check-issues-"+e.status);SiteHealth.site_status.issues[e.status]++,s=SiteHealth.site_status.issues[e.status],"critical"===e.status?t=c(n("%s critical issue","%s critical issues",s),'<span class="issue-count">'+s+"</span>"):"recommended"===e.status?t=c(n("%s recommended improvement","%s recommended improvements",s),'<span class="issue-count">'+s+"</span>"):"good"===e.status&&(t=c(n("%s item with no issues detected","%s items with no issues detected",s),'<span class="issue-count">'+s+"</span>")),t&&l(".site-health-issue-count-title",i).html(t),l(".issues","#health-check-issues-"+e.status).append(a(e))}functionp(){vare,t,s=l(".site-health-progress"),a=s.closest(".site-health-progress-wrapper"),i=l(".site-health-progress-label",a),n=l(".site-health-progress svg #bar"),c=parseInt(SiteHealth.site_status.issues.good,0)+parseInt(SiteHealth.site_status.issues.recommended,0)+1.5*parseInt(SiteHealth.site_status.issues.critical,0),h=.5*parseInt(SiteHealth.site_status.issues.recommended,0)+1.5*parseInt(SiteHealth.site_status.issues.critical,0),o=100-Math.ceil(h/c*100);0!==c?(a.removeClass("loading"),e=n.attr("r"),o<0&&(o=0),100<o&&(o=100),t=(100-o)/100*(Math.PI*(2*e)),n.css({strokeDashoffset:t}),parseInt(SiteHealth.site_status.issues.critical,0)<1&&l("#health-check-issues-critical").addClass("hidden"),parseInt(SiteHealth.site_status.issues.recommended,0)<1&&l("#health-check-issues-recommended").addClass("hidden"),80<=o&&0===parseInt(SiteHealth.site_status.issues.critical,0)?(a.addClass("green").removeClass("orange"),i.text(r("Good")),wp.a11y.speak(r("All site health tests have finished running. Your site is looking good, and the results are now available on the page."))):(a.addClass("orange").removeClass("green"),i.text(r("Should be improved")),wp.a11y.speak(r("All site health tests have finished running. There are items that should be addressed, and the results are now available on the page."))),u||(l.post(ajaxurl,{action:"health-check-site-status-result",_wpnonce:SiteHealth.nonce.site_status_result,counts:SiteHealth.site_status.issues}),100===o&&(l(".site-status-all-clear").removeClass("hide"),l(".site-status-has-issues").addClass("hide")))):s.addClass("hidden")}h.on("success",function(e){vart=l(e.trigger),s=l(".success",t.closest("div"));e.clearSelection(),t.focus(),clearTimeout(a),s.removeClass("hidden"),a=setTimeout(function(){s.addClass("hidden"),h.clipboardAction.fakeElem&&h.clipboardAction.removeFake&&h.clipboardAction.removeFake()},3e3),wp.a11y.speak(r("Site information has been copied to your clipboard."))}),l(".health-check-accordion").on("click",".health-check-accordion-trigger",function(){"true"===l(this).attr("aria-expanded")?(l(this).attr("aria-expanded","false"),l("#"+l(this).attr("aria-controls")).attr("hidden",!0)):(l(this).attr("aria-expanded","true"),l("#"+l(this).attr("aria-controls")).attr("hidden",!1))}),l(".site-health-view-passed").on("click",function(){vare=l("#health-check-issues-good");e.toggleClass("hidden"),l(this).attr("aria-expanded",!e.hasClass("hidden"))}),"undefined"==typeofSiteHealth||u||(0===SiteHealth.site_status.direct.length&&0===SiteHealth.site_status.async.length?p():SiteHealth.site_status.issues={good:0,recommended:0,critical:0},0<SiteHealth.site_status.direct.length&&l.each(SiteHealth.site_status.direct,function(){d(this)}),0<SiteHealth.site_status.async.length?(e={action:"health-check-"+SiteHealth.site_status.async[0].test.replace("_","-"),_wpnonce:SiteHealth.nonce.site_status},SiteHealth.site_status.async[0].completed=!0,l.post(ajaxurl,e,function(e){d(e.data),functiont(){vars=!0;1<=SiteHealth.site_status.async.length&&l.each(SiteHealth.site_status.async,function(){vare={action:"health-check-"+this.test.replace("_","-"),_wpnonce:SiteHealth.nonce.site_stat