| 1 |
!function(){"use strict";var e=window.EasyFontsAsync;if(e&&e.endpoint){var t=["fonts.googleapis.com","fonts-api.wp.com"],n={};if(s(Node.prototype,"appendChild"),s(Node.prototype,"insertBefore"),window.MutationObserver){var o=new MutationObserver(function(e){for(var t=0;t<e.length;t++)for(var n=e[t].addedNodes,o=0;o<n.length;o++)"LINK"===n[o].tagName&&i(n[o])});try{o.observe(document.documentElement,{childList:!0,subtree:!0})}catch(e){}}var r=null,a={};"loading"!==document.readyState?c():document.addEventListener("DOMContentLoaded",c),window.addEventListener("load",function(){c(),d()})}function i(e){try{var o=e.getAttribute?e.getAttribute("href"):e.href;if("LINK"===e.tagName&&function(e){if(!e||"string"!=typeof e)return!1;for(var n=0;n<t.length;n++)if(-1!==e.indexOf(t[n]+"/css")||-1!==e.indexOf(t[n]+"/icon"))return!0;return!1}(o))return(r=o)&&!n[r]&&(n[r]=!0,d()),e.setAttribute("data-easyfonts-async","1"),e.setAttribute("media","max-width:1px"),e.setAttribute("href","data:text/css,"),e.rel="preload",!0}catch(e){}var r;return!1}function s(e,t){if(e&&e[t]&&!e[t].__efPatched){var n=e[t];e[t]=function(e){try{e&&"LINK"===e.tagName&&i(e)}catch(e){}return n.apply(this,arguments)},e[t].__efPatched=!0}}function c(){for(var e=document.querySelectorAll('link[rel="stylesheet"],link[as="style"]'),t=0;t<e.length;t++)e[t].getAttribute("data-easyfonts-async")||i(e[t])}function d(){r&&clearTimeout(r),r=setTimeout(u,800)}function u(){var t=[];if(Object.keys(n).forEach(function(e){a[e]||(t.push(e),a[e]=!0)}),t.length){var o=JSON.stringify({urls:t}),r=e.endpoint+"?_wpnonce="+encodeURIComponent(e.nonce);if(navigator.sendBeacon)navigator.sendBeacon(r,new Blob([o],{type:"application/json"}));else try{var i=new XMLHttpRequest;i.open("POST",r,!0),i.setRequestHeader("Content-Type","application/json"),i.setRequestHeader("X-WP-Nonce",e.nonce),i.send(o)}catch(e){}}}}(); |