1 line
7.7 KiB
JavaScript
1 line
7.7 KiB
JavaScript
|
|
(function(){"use strict";var n={};!function(){n.d=function(b,L){for(var P in L){if(n.o(L,P)&&!n.o(b,P)){Object.defineProperty(b,P,{enumerable:true,get:L[P]})}}}}();!function(){n.o=function(n,b){return Object.prototype.hasOwnProperty.call(n,b)}}();!function(){n.r=function(n){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(n,"__esModule",{value:true})}}();if(typeof n!=="undefined")n.ab=__dirname+"/";var b={};n.r(b);n.d(b,{CLSThresholds:function(){return j},FCPThresholds:function(){return B},FIDThresholds:function(){return cn},INPThresholds:function(){return nn},LCPThresholds:function(){return en},TTFBThresholds:function(){return rn},onCLS:function(){return w},onFCP:function(){return S},onFID:function(){return $},onINP:function(){return N},onLCP:function(){return z},onTTFB:function(){return K}});var L,P,I,A,F,D=-1,a=function(n){addEventListener("pageshow",(function(b){b.persisted&&(D=b.timeStamp,n(b))}),!0)},c=function(){var n=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(n&&n.responseStart>0&&n.responseStart<performance.now())return n},u=function(){var n=c();return n&&n.activationStart||0},f=function(n,b){var L=c(),P="navigate";D>=0?P="back-forward-cache":L&&(document.prerendering||u()>0?P="prerender":document.wasDiscarded?P="restore":L.type&&(P=L.type.replace(/_/g,"-")));return{name:n,value:void 0===b?-1:b,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:P}},s=function(n,b,L){try{if(PerformanceObserver.supportedEntryTypes.includes(n)){var P=new PerformanceObserver((function(n){Promise.resolve().then((function(){b(n.getEntries())}))}));return P.observe(Object.assign({type:n,buffered:!0},L||{})),P}}catch(n){}},d=function(n,b,L,P){var I,A;return function(F){b.value>=0&&(F||P)&&((A=b.value-(I||0))||void 0===I)&&(I=b.value,b.delta=A,b.rating=function(n,b){return n>b[1]?"poor":n>b[0]?"needs-improvement":"good"}(b.value,L),n(b))}},l=function(n){requestAnimationFrame((function(){return requestAnimationFrame((function(){return n()}))}))},p=function(n){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&n()}))},v=function(n){var b=!1;return function(){b||(n(),b=!0)}},O=-1,h=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},g=function(n){"hidden"===document.visibilityState&&O>-1&&(O="visibilitychange"===n.type?n.timeStamp:0,T())},y=function(){addEventListener("visibilitychange",g,!0),addEventListener("prerenderingchange",g,!0)},T=function(){removeEventListener("visibilitychange",g,!0),removeEventListener("prerenderingchange",g,!0)},E=function(){return O<0&&(O=h(),y(),a((function(){setTimeout((function(){O=h(),y()}),0)}))),{get firstHiddenTime(){return O}}},C=function(n){document.prerendering?addEventListener("prerenderingchange",(function(){return n()}),!0):n()},B=[1800,3e3],S=function(n,b){b=b||{},C((function(){var L,P=E(),I=f("FCP"),A=s("paint",(function(n){n.forEach((function(n){"first-contentful-paint"===n.name&&(A.disconnect(),n.startTime<P.firstHiddenTime&&(I.value=Math.max(n.startTime-u(),0),I.entries.push(n),L(!0)))}))}));A&&(L=d(n,I,B,b.reportAllChanges),a((function(P){I=f("FCP"),L=d(n,I,B,b.reportAllChanges),l((function(){I.value=performance.now()-P.timeStamp,L(!0)}))})))}))},j=[.1,.25],w=function(n,b){b=b||{},S(v((function(){var L,P=f("CLS",0),I=0,A=[],c=function(n){n.forEach((function(n){if(!n.hadRecentInput){var b=A[0],L=A[A.length-1];I&&n.startTime-L.startTime<1e3&&n.startTime-b.startTime<5e3?(I+=n.value,A.push(n)):(I=n.value,A=[n])}})),I>P.value&&(P.value=I,P.entries=A,L())},F=s("layout-shift",c);F&&(L=d(n,P,j,b.reportAllChanges),p((function(){c(F.takeRecords()),L(!0)})),a((function(){I=0,P=f("CLS",0),L=d(n,P,j,b.reportAllChanges),l((function(){return L()}))})),setTimeout(L,0))})))},x=0,_=1/0,G=0,M=function(n){n.forEach((function(n){n.interactionId&&(_=Math.min(_,n.interactionId),G=Math.max(G,n.interactionId),x=G?(G-_)/7+1:0)
|