1(function(){class CSSUsageCollector{constructor(e=!0,t=[]){this.cacheDir="undefined"!=typeof speed_css_vars&&speed_css_vars.cache_directory?speed_css_vars.cache_directory:"acd-unused-css",this.stylesheetsCSS={},this.selectorTexts={},this.selectorTexts.rules={},this.selectorTexts.keyframes={},this.selectorTexts.fonts={},this.currentHost=window.location.host,this.logWarnings=e,this.includePatterns=t,this.totalOriginalLength=0,this.totalFilteredLength=0,this.has_collected=!1,this.observedClasses=new Set,this.initialClassesMap=new Map,this.foundFamilies=new Set,this.usedFontRules=new Set,this.usedKeyframes=new Set,this.debug_selector="",this.debug=!1}collect_when_idle(){void 0!==this.scrollListener&&window.removeEventListener("scroll",this.scrollListener),requestIdleCallback((()=>{0==this.has_collected&&(this.debug&&console.log("Collecting after idle"),this.flash_scroll(),this.collect())}))}async collect(){if(this.debug&&console.log("Start collect"),1!=this.has_collected){"function"==typeof window.unused_css_restoreTemplateContent&&window.unused_css_restoreTemplateContent(),this.has_collected=!0;var e=document.body.className.split(/\s+/),t=/^(rtl|home|blog|privacy-policy|archive|date|search(-[a-zA-Z0-9-_]+)?|paged|attachment|error404|[a-zA-Z0-9-__]+-template|single(-[a-zA-Z0-9-_]+)?|page(-[a-zA-Z0-9-_]+)?|post-type-archive(-[a-zA-Z0-9-_]+)?|author(-[a-zA-Z0-9-_]+)?|category(-[a-zA-Z0-9-_]+)?|tag(-[a-zA-Z0-9-_]+)?|tax(-[a-zA-Z0-9-_]+)?|term(-[a-zA-Z0-9-_]+)?)$/,s=e.filter((function(e){return t.test(e)}));this.debug&&console.log("Set vars 1");var o=this.getAllInvisibleElements();this.debug&&console.log("Got invisible element"),await this.getLcpImage().then((e=>{var t;this.updateConfig({csrf:window.spdy_csrfToken,force_includes:[...this.observedClasses],url:document.location.href,post_id:(null==(t=document.body.className.split(" ").find((e=>e.startsWith("postid-")||e.startsWith("page-id-"))))?void 0:t.replace(/(postid-|page-id-)/,""))||null,post_types:s,invisible:{elements:o,viewport:{width:window.innerWidth,height:window.innerHeight}},usedFontRules:[...this.getFontsDownloaded()].join("|"),lcp_image:e})}))}else this.debug&&console.log("Already collected")}updateConfig(e){this.debug&&console.log("Update config with ",e),(async()=>{try{const t=JSON.stringify(e),s=await this.compressAndBase64Encode(t);if(0==s)return void console.warn("Unable to update CSS on this browser");const o=await fetch("/wp-json/dh-functions/update_css",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({compressedData:s})}),n=await o.json();console.log("Successfully updated CSS:",n)}catch(t){console.log("Error updating config:",t)}})()}getFontsDownloaded(){if(!1 in performance)return new Set;const e=new Set,t=(e,t)=>{try{return new URL(e,t).href}catch(s){return e}};for(const n of document.styleSheets)try{const s=n.href||document.baseURI;for(const o of n.cssRules)if(o.type===CSSRule.FONT_FACE_RULE){const n=o.style.getPropertyValue("src");if(n){const o=n.match(/url\(([^)]+)\)/g);o&&o.forEach((o=>{const n=o.replace(/url\(|\)|'|"/g,"").trim(),r=t(n,s);e.add(r)}))}}}catch(o){}const s=new Set;return performance.getEntriesByType("resource").forEach((o=>{const n=t(o.name,document.baseURI);e.has(n)&&s.add(o.name)})),s}getLcpImage(){return new Promise((e=>{if(!("PerformanceObserver"in window)||!PerformanceObserver.supportedEntryTypes.includes("largest-contentful-paint"))return void e("");let t=null;const s=new PerformanceObserver((o=>{for(const e of o.getEntries())e.element&&"IMG"===e.element.tagName&&(t=e.element.src);t&&(e(t),s.disconnect())}));s.observe({type:"largest-contentful-paint",buffered:!0}),setTimeout((()=>{s.disconnect(),t||e("")}),500)}))}warn(...e){this.logWarnings&&console.warn(...e)}async compressAndBase64Encode(e){try{const t=(new TextEncoder).encode(e),s=new Blob([t]).stream(),o=s.pipeThrough(new CompressionStream("gzip")).getReader(),n=[];let r,l;for(;({done:r,value:l}=await o.read()),!r;)n.push(l);const i=this.concatUint8Arrays(n);let c="";for(let e=0;e<i.length;e++)c+=String.fromCharCode(i[e]);return btoa(c)}catch(t){return!1}}concatUint8Arrays(e){let t=e.reduce(((e,t)=>e+t.length),0),s=new Uint8Array(t),o=0;for(let n of e)s.set(n,o),o+=n.length;return s}getAllInvisibleElements(e=document.body){const t=[];return function e(s){if(s!==document.body){const e=function(e){let t=0,s=0,o=e;for(;o;)t+=o.offsetLeft-o.scrollLeft+(parseFloat(window.getComputedStyle(o).borderLeftWidth)||0),s+=o.offsetTop-o.scrollTop+(parseFloat(window.getComputedStyle(o).borderTopWidth)||0),o=o.offsetParent;return{x:t,y:s}}(s),o=window.getComputedStyle(s),n=s.offsetWidth>0&&s.offsetHeight>0,r=0,l=1366,i=e.y,c=i+s.offsetHeight;e.x;s.offsetWidth;const a=c<=r||i>=l,d="fixed"===o.position||"sticky"===o.position,h="hidden"===o.visibility||"0"===o.opacity||"none"===o.display||"rect(1px, 1px, 1px, 1px)"===o.clip||"inset(50%)"===o.clipPath||parseFloat(o.width)<=1&&parseFloat(o.height)<=1||"hidden"===o.overflow&&parseFloat(o.height)<=1;if(a&&n&&!h&&!d)return void t.push({spuid:s.dataset.spuid})}for(let t of s.children)e(t)}(e),t}recordInitialClasses(){document.querySelectorAll("*").forEach((e=>{this.initialClassesMap.set(e,new Set(e.classList))}))}start_collect_added_classes(){this.recordInitialClasses();new MutationObserver((e=>{for(const t of e)if("attributes"===t.type&&"class"===t.attributeName){const e=t.target,s=this.initialClassesMap.get(e)||new Set;e.classList.forEach((e=>{s.has(e)||this.observedClasses.has(e)||this.observedClasses.add(e)}))}})).observe(document.body,{attributes:!0,subtree:!0})}collect_after_scroll(e=!1){e&&(this.debug=!0,console.log("Start collecting after scroll")),this.start_collect_added_classes(),this.scrollListener=()=>{clearTimeout(window.scrollIdleTimeout),window.scrollIdleTimeout=setTimeout((()=>{this.debug&&console.log("Collecting after scroll"),this.collect_when_idle()}),1e3)},setTimeout((()=>{this.debug&&console.log("Collecting after timeout"),window.removeEventListener("scroll",this.scrollListener),this.collect_when_idle()}),5e3),window.addEventListener("scroll",this.scrollListener)}flash_scroll(){const e=window.scrollY;window.scrollTo({top:0,behavior:"instant"}),window.scrollTo({top:document.documentElement.scrollHeight,behavior:"instant"}),window.dispatchEvent(new Event("scroll")),window.scrollTo({top:e,behavior:"instant"})}}!function(){const e=window.innerWidth;let t;t=e<=768?"mobile":e>768&&e<=1024?"tablet":"desktop";let s=document.querySelectorAll("style[rel='spress-inlined']").length,o=document.querySelectorAll('link[rel="stylesheet"][href]:not([data-spress-processed="true"])').length,n=new URL(window.location.href).hostname;if(Array.prototype.forEach.call(document.querySelectorAll('link[rel="stylesheet"][href]:not([data-spress-processed="true"])'),(function(e){new URL(e.href).hostname!==n&&o--}
1)),"true"==={desktop:"true"}[t]&&0===s&&o>0){var r=JSON.parse(speed_css_vars.include_patterns);r=r.map((e=>new RegExp(e.replace(/\\\\/g,"\\"))));new CSSUsageCollector(!1,r).collect_after_scroll(!1)}}();})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.