Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

perfume.js

Package Overview
Dependencies
Maintainers
1
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

perfume.js - npm Package Compare versions

Comparing version 6.4.0 to 7.0.0

4

CHANGELOG.md
# Changelog
## 7.0.0 (2022-2-21)
* **feat:** changed both TBT and NTBT Vitals to be less than 200 milliseconds for Good Score.
## 6.4.0 (2022-2-21)

@@ -4,0 +8,0 @@

4

dist/es/perfume.js
/*!
* Perfume.js v6.2.0 (http://zizzamia.github.io/perfume)
* Perfume.js v7.0.0 (http://zizzamia.github.io/perfume)
* Copyright 2022 Leonardo Zizzamia (https://github.com/Zizzamia/perfume.js/graphs/contributors)

@@ -23,3 +23,3 @@ * Licensed under MIT (https://github.com/Zizzamia/perfume.js/blob/master/LICENSE)

if (options === void 0) { options = {}; }
this.v = '6.4.0';
this.v = '7.0.0';
// Extend default config with external options

@@ -26,0 +26,0 @@ config.analyticsTracker = options.analyticsTracker;

@@ -6,4 +6,4 @@ var ttfbScore = [200, 500];

var clsScore = [0.1, 0.25];
var tbtScore = [300, 600];
var ntbtScore = [400, 600];
var tbtScore = [200, 600];
var ntbtScore = [200, 600];
export var webVitalsScore = {

@@ -10,0 +10,0 @@ ttfb: ttfbScore,

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/*!
* Perfume.js v6.2.0 (http://zizzamia.github.io/perfume)
* Perfume.js v7.0.0 (http://zizzamia.github.io/perfume)
* Copyright 2022 Leonardo Zizzamia (https://github.com/Zizzamia/perfume.js/graphs/contributors)

@@ -25,3 +25,3 @@ * Licensed under MIT (https://github.com/Zizzamia/perfume.js/blob/master/LICENSE)

if (options === void 0) { options = {}; }
this.v = '6.4.0';
this.v = '7.0.0';
// Extend default config with external options

@@ -28,0 +28,0 @@ config_1.config.analyticsTracker = options.analyticsTracker;

@@ -8,4 +8,4 @@ "use strict";

var clsScore = [0.1, 0.25];
var tbtScore = [300, 600];
var ntbtScore = [400, 600];
var tbtScore = [200, 600];
var ntbtScore = [200, 600];
exports.webVitalsScore = {

@@ -12,0 +12,0 @@ ttfb: ttfbScore,

@@ -1,2 +0,2 @@

var n={t:!1,i:!1,o:3e4},t=window,e=t.console,i=document,r=t.navigator,o=t.performance,u=function(){return r.deviceMemory},c=function(){return r.hardwareConcurrency},a=function(){return o&&!!o.getEntriesByType&&!!o.now&&!!o.mark},f="4g",s=!1,l=function(){return!!(c()&&c()<=4)||!!(u()&&u()<=4)},m=function(n,t){switch(n){case"slow-2g":case"2g":case"3g":return!0;default:return l()||t}},v={u:!1},d=function(n){i.hidden&&(n(),v.u=i.hidden)},p=function(n){return parseFloat(n.toFixed(4))},g=function(n){return"number"!=typeof n?null:p(n/Math.pow(1024,2))},b=[2e3,4e3],h=[2500,4e3],T=[.1,.25],k={ttfb:[200,500],fp:b,fcp:b,lcp:h,lcpFinal:h,fid:[100,300],cls:T,clsFinal:T,tbt:[300,600],ntbt:[400,600]},y=function(n,t){return k[n]?t<=k[n][0]?"good":t<=k[n][1]?"needsImprovement":"poor":null},w=function(e,i,o){var a;a=function(){v.u&&e.indexOf("Final")<0||!n.analyticsTracker||n.analyticsTracker({metricName:e,data:i,eventProperties:o||{},navigatorInformation:r?{deviceMemory:u()||0,hardwareConcurrency:c()||0,serviceWorkerStatus:"serviceWorker"in r?r.serviceWorker.controller?"controlled":"supported":"unsupported",isLowEndDevice:l(),isLowEndExperience:m(f,s)}:{},vitalsScore:y(e,i)})},"requestIdleCallback"in t?t.requestIdleCallback(a,{timeout:3e3}):a()},_=function(n,t,e){Object.keys(t).forEach((function(n){"number"==typeof t[n]&&(t[n]=p(t[n]))})),w(n,t,e)},F=function(t,e,i){var r=p(t);r<=n.o&&r>=0&&w(e,r,i)},E={},x={value:0},D={value:0},I={value:0},P={value:{beacon:0,css:0,fetch:0,img:0,other:0,script:0,total:0,xmlhttprequest:0}},j={value:0},q={value:0},C=function(n){var t=n.pop();t&&!t.s&&t.value&&(x.value+=t.value)},L={},O=function(n,t){try{var i=new PerformanceObserver((function(n){t(n.getEntries())}));return i.observe({type:n,buffered:!0}),i}catch(n){e.warn("Perfume.js:",n)}return null},S=function(n){L[n]&&L[n].disconnect(),delete L[n]},W=function(n){var t=n.pop();t&&F(t.processingStart-t.startTime,"fid",{performanceEntry:t}),S(1),F(I.value,"lcp"),L[3]&&"function"==typeof L[3].takeRecords&&L[3].takeRecords(),F(x.value,"cls"),setTimeout((function(){F(j.value,"tbt"),_("dataConsumption",P.value)}),1e4)},B=function(n){n.forEach((function(n){if(!("self"!==n.name||n.startTime<D.value)){var t=n.duration-50;t>0&&(j.value+=t,q.value+=t)}}))},M=function(n){n.forEach((function(n){"first-paint"===n.name?F(n.startTime,"fp"):"first-contentful-paint"===n.name&&(D.value=n.startTime,F(D.value,"fcp"),L[4]=O("longtask",B),S(0))}))},z=function(n){var t=n.pop();t&&(I.value=t.renderTime||t.loadTime)},H=function(n){n.forEach((function(n){n.identifier&&F(n.startTime,n.identifier)}))},N=function(t){t.forEach((function(t){if(n.t&&_("resourceTiming",t),t.decodedBodySize&&t.initiatorType){var e=t.decodedBodySize/1e3;P.value[t.initiatorType]+=e,P.value.total+=e}}))},R=function(){L[2]&&(F(I.value,"lcpFinal"),S(2)),L[3]&&("function"==typeof L[3].takeRecords&&L[3].takeRecords(),F(x.value,"clsFinal"),S(3))},A=function(n){var t="usageDetails"in n?n.usageDetails:{};_("storageEstimate",{quota:g(n.quota),usage:g(n.usage),caches:g(t.caches),indexedDB:g(t.indexedDB),serviceWorker:g(t.serviceWorkerRegistrations)})},G=0,J=function(){function e(e){if(void 0===e&&(e={}),this.l="6.4.0",n.analyticsTracker=e.analyticsTracker,n.t=!!e.resourceTiming,n.i=!!e.elementTiming,n.o=e.maxMeasureTime||n.o,a()){"PerformanceObserver"in t&&(L[0]=O("paint",M),L[1]=O("first-input",W),L[2]=O("largest-contentful-paint",z),n.t&&O("resource",N),L[3]=O("layout-shift",C),n.i&&O("element",H)),void 0!==i.hidden&&i.addEventListener("visibilitychange",d.bind(this,R));var u=function(){if(!a())return{};var n=o.getEntriesByType("navigation")[0];if(!n)return{};var t=n.responseStart,e=n.responseEnd;return{fetchTime:e-n.fetchStart,workerTime:n.workerStart>0?e-n.workerStart:0,totalTime:e-n.requestStart,downloadTime:e-t,timeToFirstByte:t-n.requestStart,headerSize:n.transferSize-n.encodedBodySize||0,dnsLookupTime:n.domainLookupEnd-n.domainLookupStart,redirectTime:n.redirectEnd-n.redirectStart}}();_("navigationTiming",u),u.timeToFirstByte&&F(u.timeToFirstByte,"ttfb"),_("networkInformation",function(){if("connection"in r){var n=r.connection;return"object"!=typeof n?{}:(f=n.effectiveType,s=!!n.saveData,{downlink:n.downlink,effectiveType:n.effectiveType,rtt:n.rtt,saveData:!!n.saveData})}return{}}()),r&&r.storage&&"function"==typeof r.storage.estimate&&r.storage.estimate().then(A)}}return e.prototype.start=function(n){a()&&!E[n]&&(E[n]=!0,o.mark("mark_"+n+"_start"),v.u=!1)},e.prototype.end=function(n,t,e){if(void 0===t&&(t={}),void 0===e&&(e=!0),a()&&E[n]){o.mark("mark_"+n+"_end"),delete E[n];var i=function(n){o.measure(n,"mark_"+n+"_start","mark_"+n+"_end");var t=o.getEntriesByName(n).pop();return t&&"measure"===t.entryType?t.duration:-1}(n);e&&_(n,p(i),t)}},e.prototype.endPaint=function(n,t){var e=this;setTimeout((function(){e.end(n,t)}))},e.prototype.clear=function(n){delete E[n],o.clearMarks&&(o.clearMarks("mark_"+n+"_start"),o.clearMarks("mark_"+n+"_end"))},e.prototype.markNTBT=function(){var n=this;this.start("ntbt"),q.value=0,clearTimeout(G),G=setTimeout((function(){n.end("ntbt",{},!1),F(q.value,"ntbt"),q.value=0}),2e3)},e}();export default J;
var n={t:!1,i:!1,o:3e4},t=window,e=t.console,i=document,r=t.navigator,o=t.performance,u=function(){return r.deviceMemory},c=function(){return r.hardwareConcurrency},a=function(){return o&&!!o.getEntriesByType&&!!o.now&&!!o.mark},f="4g",s=!1,l=function(){return!!(c()&&c()<=4)||!!(u()&&u()<=4)},m=function(n,t){switch(n){case"slow-2g":case"2g":case"3g":return!0;default:return l()||t}},v={u:!1},d=function(n){i.hidden&&(n(),v.u=i.hidden)},p=function(n){return parseFloat(n.toFixed(4))},g=function(n){return"number"!=typeof n?null:p(n/Math.pow(1024,2))},b=[2e3,4e3],h=[2500,4e3],T=[.1,.25],k={ttfb:[200,500],fp:b,fcp:b,lcp:h,lcpFinal:h,fid:[100,300],cls:T,clsFinal:T,tbt:[200,600],ntbt:[200,600]},y=function(n,t){return k[n]?t<=k[n][0]?"good":t<=k[n][1]?"needsImprovement":"poor":null},w=function(e,i,o){var a;a=function(){v.u&&e.indexOf("Final")<0||!n.analyticsTracker||n.analyticsTracker({metricName:e,data:i,eventProperties:o||{},navigatorInformation:r?{deviceMemory:u()||0,hardwareConcurrency:c()||0,serviceWorkerStatus:"serviceWorker"in r?r.serviceWorker.controller?"controlled":"supported":"unsupported",isLowEndDevice:l(),isLowEndExperience:m(f,s)}:{},vitalsScore:y(e,i)})},"requestIdleCallback"in t?t.requestIdleCallback(a,{timeout:3e3}):a()},_=function(n,t,e){Object.keys(t).forEach((function(n){"number"==typeof t[n]&&(t[n]=p(t[n]))})),w(n,t,e)},F=function(t,e,i){var r=p(t);r<=n.o&&r>=0&&w(e,r,i)},E={},x={value:0},D={value:0},I={value:0},P={value:{beacon:0,css:0,fetch:0,img:0,other:0,script:0,total:0,xmlhttprequest:0}},j={value:0},q={value:0},C=function(n){var t=n.pop();t&&!t.s&&t.value&&(x.value+=t.value)},L={},O=function(n,t){try{var i=new PerformanceObserver((function(n){t(n.getEntries())}));return i.observe({type:n,buffered:!0}),i}catch(n){e.warn("Perfume.js:",n)}return null},S=function(n){L[n]&&L[n].disconnect(),delete L[n]},W=function(n){var t=n.pop();t&&F(t.processingStart-t.startTime,"fid",{performanceEntry:t}),S(1),F(I.value,"lcp"),L[3]&&"function"==typeof L[3].takeRecords&&L[3].takeRecords(),F(x.value,"cls"),setTimeout((function(){F(j.value,"tbt"),_("dataConsumption",P.value)}),1e4)},B=function(n){n.forEach((function(n){if(!("self"!==n.name||n.startTime<D.value)){var t=n.duration-50;t>0&&(j.value+=t,q.value+=t)}}))},M=function(n){n.forEach((function(n){"first-paint"===n.name?F(n.startTime,"fp"):"first-contentful-paint"===n.name&&(D.value=n.startTime,F(D.value,"fcp"),L[4]=O("longtask",B),S(0))}))},z=function(n){var t=n.pop();t&&(I.value=t.renderTime||t.loadTime)},H=function(n){n.forEach((function(n){n.identifier&&F(n.startTime,n.identifier)}))},N=function(t){t.forEach((function(t){if(n.t&&_("resourceTiming",t),t.decodedBodySize&&t.initiatorType){var e=t.decodedBodySize/1e3;P.value[t.initiatorType]+=e,P.value.total+=e}}))},R=function(){L[2]&&(F(I.value,"lcpFinal"),S(2)),L[3]&&("function"==typeof L[3].takeRecords&&L[3].takeRecords(),F(x.value,"clsFinal"),S(3))},A=function(n){var t="usageDetails"in n?n.usageDetails:{};_("storageEstimate",{quota:g(n.quota),usage:g(n.usage),caches:g(t.caches),indexedDB:g(t.indexedDB),serviceWorker:g(t.serviceWorkerRegistrations)})},G=0,J=function(){function e(e){if(void 0===e&&(e={}),this.l="7.0.0",n.analyticsTracker=e.analyticsTracker,n.t=!!e.resourceTiming,n.i=!!e.elementTiming,n.o=e.maxMeasureTime||n.o,a()){"PerformanceObserver"in t&&(L[0]=O("paint",M),L[1]=O("first-input",W),L[2]=O("largest-contentful-paint",z),n.t&&O("resource",N),L[3]=O("layout-shift",C),n.i&&O("element",H)),void 0!==i.hidden&&i.addEventListener("visibilitychange",d.bind(this,R));var u=function(){if(!a())return{};var n=o.getEntriesByType("navigation")[0];if(!n)return{};var t=n.responseStart,e=n.responseEnd;return{fetchTime:e-n.fetchStart,workerTime:n.workerStart>0?e-n.workerStart:0,totalTime:e-n.requestStart,downloadTime:e-t,timeToFirstByte:t-n.requestStart,headerSize:n.transferSize-n.encodedBodySize||0,dnsLookupTime:n.domainLookupEnd-n.domainLookupStart,redirectTime:n.redirectEnd-n.redirectStart}}();_("navigationTiming",u),u.timeToFirstByte&&F(u.timeToFirstByte,"ttfb"),_("networkInformation",function(){if("connection"in r){var n=r.connection;return"object"!=typeof n?{}:(f=n.effectiveType,s=!!n.saveData,{downlink:n.downlink,effectiveType:n.effectiveType,rtt:n.rtt,saveData:!!n.saveData})}return{}}()),r&&r.storage&&"function"==typeof r.storage.estimate&&r.storage.estimate().then(A)}}return e.prototype.start=function(n){a()&&!E[n]&&(E[n]=!0,o.mark("mark_"+n+"_start"),v.u=!1)},e.prototype.end=function(n,t,e){if(void 0===t&&(t={}),void 0===e&&(e=!0),a()&&E[n]){o.mark("mark_"+n+"_end"),delete E[n];var i=function(n){o.measure(n,"mark_"+n+"_start","mark_"+n+"_end");var t=o.getEntriesByName(n).pop();return t&&"measure"===t.entryType?t.duration:-1}(n);e&&_(n,p(i),t)}},e.prototype.endPaint=function(n,t){var e=this;setTimeout((function(){e.end(n,t)}))},e.prototype.clear=function(n){delete E[n],o.clearMarks&&(o.clearMarks("mark_"+n+"_start"),o.clearMarks("mark_"+n+"_end"))},e.prototype.markNTBT=function(){var n=this;this.start("ntbt"),q.value=0,clearTimeout(G),G=setTimeout((function(){n.end("ntbt",{},!1),F(q.value,"ntbt"),q.value=0}),2e3)},e}();export default J;
//# sourceMappingURL=perfume.esm.min.js.map

@@ -1,2 +0,2 @@

var Perfume=function(){"use strict";var n={t:!1,i:!1,o:3e4},t=window,e=t.console,i=document,r=t.navigator,o=t.performance,u=function(){return r.deviceMemory},c=function(){return r.hardwareConcurrency},a=function(){return o&&!!o.getEntriesByType&&!!o.now&&!!o.mark},f="4g",s=!1,l=function(){return!!(c()&&c()<=4)||!!(u()&&u()<=4)},m=function(n,t){switch(n){case"slow-2g":case"2g":case"3g":return!0;default:return l()||t}},v={u:!1},d=function(n){i.hidden&&(n(),v.u=i.hidden)},p=function(n){return parseFloat(n.toFixed(4))},g=function(n){return"number"!=typeof n?null:p(n/Math.pow(1024,2))},b=[2e3,4e3],h=[2500,4e3],T=[.1,.25],k={ttfb:[200,500],fp:b,fcp:b,lcp:h,lcpFinal:h,fid:[100,300],cls:T,clsFinal:T,tbt:[300,600],ntbt:[400,600]},y=function(n,t){return k[n]?t<=k[n][0]?"good":t<=k[n][1]?"needsImprovement":"poor":null},w=function(e,i,o){var a;a=function(){v.u&&e.indexOf("Final")<0||!n.analyticsTracker||n.analyticsTracker({metricName:e,data:i,eventProperties:o||{},navigatorInformation:r?{deviceMemory:u()||0,hardwareConcurrency:c()||0,serviceWorkerStatus:"serviceWorker"in r?r.serviceWorker.controller?"controlled":"supported":"unsupported",isLowEndDevice:l(),isLowEndExperience:m(f,s)}:{},vitalsScore:y(e,i)})},"requestIdleCallback"in t?t.requestIdleCallback(a,{timeout:3e3}):a()},_=function(n,t,e){Object.keys(t).forEach((function(n){"number"==typeof t[n]&&(t[n]=p(t[n]))})),w(n,t,e)},F=function(t,e,i){var r=p(t);r<=n.o&&r>=0&&w(e,r,i)},E={},P={value:0},x={value:0},D={value:0},I={value:{beacon:0,css:0,fetch:0,img:0,other:0,script:0,total:0,xmlhttprequest:0}},j={value:0},q={value:0},C=function(n){var t=n.pop();t&&!t.s&&t.value&&(P.value+=t.value)},L={},O=function(n,t){try{var i=new PerformanceObserver((function(n){t(n.getEntries())}));return i.observe({type:n,buffered:!0}),i}catch(n){e.warn("Perfume.js:",n)}return null},S=function(n){L[n]&&L[n].disconnect(),delete L[n]},W=function(n){var t=n.pop();t&&F(t.processingStart-t.startTime,"fid",{performanceEntry:t}),S(1),F(D.value,"lcp"),L[3]&&"function"==typeof L[3].takeRecords&&L[3].takeRecords(),F(P.value,"cls"),setTimeout((function(){F(j.value,"tbt"),_("dataConsumption",I.value)}),1e4)},B=function(n){n.forEach((function(n){if(!("self"!==n.name||n.startTime<x.value)){var t=n.duration-50;t>0&&(j.value+=t,q.value+=t)}}))},M=function(n){n.forEach((function(n){"first-paint"===n.name?F(n.startTime,"fp"):"first-contentful-paint"===n.name&&(x.value=n.startTime,F(x.value,"fcp"),L[4]=O("longtask",B),S(0))}))},z=function(n){var t=n.pop();t&&(D.value=t.renderTime||t.loadTime)},H=function(n){n.forEach((function(n){n.identifier&&F(n.startTime,n.identifier)}))},N=function(t){t.forEach((function(t){if(n.t&&_("resourceTiming",t),t.decodedBodySize&&t.initiatorType){var e=t.decodedBodySize/1e3;I.value[t.initiatorType]+=e,I.value.total+=e}}))},R=function(){L[2]&&(F(D.value,"lcpFinal"),S(2)),L[3]&&("function"==typeof L[3].takeRecords&&L[3].takeRecords(),F(P.value,"clsFinal"),S(3))},A=function(n){var t="usageDetails"in n?n.usageDetails:{};_("storageEstimate",{quota:g(n.quota),usage:g(n.usage),caches:g(t.caches),indexedDB:g(t.indexedDB),serviceWorker:g(t.serviceWorkerRegistrations)})},G=0;return function(){function e(e){if(void 0===e&&(e={}),this.l="6.4.0",n.analyticsTracker=e.analyticsTracker,n.t=!!e.resourceTiming,n.i=!!e.elementTiming,n.o=e.maxMeasureTime||n.o,a()){"PerformanceObserver"in t&&(L[0]=O("paint",M),L[1]=O("first-input",W),L[2]=O("largest-contentful-paint",z),n.t&&O("resource",N),L[3]=O("layout-shift",C),n.i&&O("element",H)),void 0!==i.hidden&&i.addEventListener("visibilitychange",d.bind(this,R));var u=function(){if(!a())return{};var n=o.getEntriesByType("navigation")[0];if(!n)return{};var t=n.responseStart,e=n.responseEnd;return{fetchTime:e-n.fetchStart,workerTime:n.workerStart>0?e-n.workerStart:0,totalTime:e-n.requestStart,downloadTime:e-t,timeToFirstByte:t-n.requestStart,headerSize:n.transferSize-n.encodedBodySize||0,dnsLookupTime:n.domainLookupEnd-n.domainLookupStart,redirectTime:n.redirectEnd-n.redirectStart}}();_("navigationTiming",u),u.timeToFirstByte&&F(u.timeToFirstByte,"ttfb"),_("networkInformation",function(){if("connection"in r){var n=r.connection;return"object"!=typeof n?{}:(f=n.effectiveType,s=!!n.saveData,{downlink:n.downlink,effectiveType:n.effectiveType,rtt:n.rtt,saveData:!!n.saveData})}return{}}()),r&&r.storage&&"function"==typeof r.storage.estimate&&r.storage.estimate().then(A)}}return e.prototype.start=function(n){a()&&!E[n]&&(E[n]=!0,o.mark("mark_"+n+"_start"),v.u=!1)},e.prototype.end=function(n,t,e){if(void 0===t&&(t={}),void 0===e&&(e=!0),a()&&E[n]){o.mark("mark_"+n+"_end"),delete E[n];var i=function(n){o.measure(n,"mark_"+n+"_start","mark_"+n+"_end");var t=o.getEntriesByName(n).pop();return t&&"measure"===t.entryType?t.duration:-1}(n);e&&_(n,p(i),t)}},e.prototype.endPaint=function(n,t){var e=this;setTimeout((function(){e.end(n,t)}))},e.prototype.clear=function(n){delete E[n],o.clearMarks&&(o.clearMarks("mark_"+n+"_start"),o.clearMarks("mark_"+n+"_end"))},e.prototype.markNTBT=function(){var n=this;this.start("ntbt"),q.value=0,clearTimeout(G),G=setTimeout((function(){n.end("ntbt",{},!1),F(q.value,"ntbt"),q.value=0}),2e3)},e}()}();
var Perfume=function(){"use strict";var n={t:!1,i:!1,o:3e4},t=window,e=t.console,i=document,r=t.navigator,o=t.performance,u=function(){return r.deviceMemory},c=function(){return r.hardwareConcurrency},a=function(){return o&&!!o.getEntriesByType&&!!o.now&&!!o.mark},f="4g",s=!1,l=function(){return!!(c()&&c()<=4)||!!(u()&&u()<=4)},m=function(n,t){switch(n){case"slow-2g":case"2g":case"3g":return!0;default:return l()||t}},v={u:!1},d=function(n){i.hidden&&(n(),v.u=i.hidden)},p=function(n){return parseFloat(n.toFixed(4))},g=function(n){return"number"!=typeof n?null:p(n/Math.pow(1024,2))},b=[2e3,4e3],h=[2500,4e3],T=[.1,.25],k={ttfb:[200,500],fp:b,fcp:b,lcp:h,lcpFinal:h,fid:[100,300],cls:T,clsFinal:T,tbt:[200,600],ntbt:[200,600]},y=function(n,t){return k[n]?t<=k[n][0]?"good":t<=k[n][1]?"needsImprovement":"poor":null},w=function(e,i,o){var a;a=function(){v.u&&e.indexOf("Final")<0||!n.analyticsTracker||n.analyticsTracker({metricName:e,data:i,eventProperties:o||{},navigatorInformation:r?{deviceMemory:u()||0,hardwareConcurrency:c()||0,serviceWorkerStatus:"serviceWorker"in r?r.serviceWorker.controller?"controlled":"supported":"unsupported",isLowEndDevice:l(),isLowEndExperience:m(f,s)}:{},vitalsScore:y(e,i)})},"requestIdleCallback"in t?t.requestIdleCallback(a,{timeout:3e3}):a()},_=function(n,t,e){Object.keys(t).forEach((function(n){"number"==typeof t[n]&&(t[n]=p(t[n]))})),w(n,t,e)},F=function(t,e,i){var r=p(t);r<=n.o&&r>=0&&w(e,r,i)},E={},P={value:0},x={value:0},D={value:0},I={value:{beacon:0,css:0,fetch:0,img:0,other:0,script:0,total:0,xmlhttprequest:0}},j={value:0},q={value:0},C=function(n){var t=n.pop();t&&!t.s&&t.value&&(P.value+=t.value)},L={},O=function(n,t){try{var i=new PerformanceObserver((function(n){t(n.getEntries())}));return i.observe({type:n,buffered:!0}),i}catch(n){e.warn("Perfume.js:",n)}return null},S=function(n){L[n]&&L[n].disconnect(),delete L[n]},W=function(n){var t=n.pop();t&&F(t.processingStart-t.startTime,"fid",{performanceEntry:t}),S(1),F(D.value,"lcp"),L[3]&&"function"==typeof L[3].takeRecords&&L[3].takeRecords(),F(P.value,"cls"),setTimeout((function(){F(j.value,"tbt"),_("dataConsumption",I.value)}),1e4)},B=function(n){n.forEach((function(n){if(!("self"!==n.name||n.startTime<x.value)){var t=n.duration-50;t>0&&(j.value+=t,q.value+=t)}}))},M=function(n){n.forEach((function(n){"first-paint"===n.name?F(n.startTime,"fp"):"first-contentful-paint"===n.name&&(x.value=n.startTime,F(x.value,"fcp"),L[4]=O("longtask",B),S(0))}))},z=function(n){var t=n.pop();t&&(D.value=t.renderTime||t.loadTime)},H=function(n){n.forEach((function(n){n.identifier&&F(n.startTime,n.identifier)}))},N=function(t){t.forEach((function(t){if(n.t&&_("resourceTiming",t),t.decodedBodySize&&t.initiatorType){var e=t.decodedBodySize/1e3;I.value[t.initiatorType]+=e,I.value.total+=e}}))},R=function(){L[2]&&(F(D.value,"lcpFinal"),S(2)),L[3]&&("function"==typeof L[3].takeRecords&&L[3].takeRecords(),F(P.value,"clsFinal"),S(3))},A=function(n){var t="usageDetails"in n?n.usageDetails:{};_("storageEstimate",{quota:g(n.quota),usage:g(n.usage),caches:g(t.caches),indexedDB:g(t.indexedDB),serviceWorker:g(t.serviceWorkerRegistrations)})},G=0;return function(){function e(e){if(void 0===e&&(e={}),this.l="7.0.0",n.analyticsTracker=e.analyticsTracker,n.t=!!e.resourceTiming,n.i=!!e.elementTiming,n.o=e.maxMeasureTime||n.o,a()){"PerformanceObserver"in t&&(L[0]=O("paint",M),L[1]=O("first-input",W),L[2]=O("largest-contentful-paint",z),n.t&&O("resource",N),L[3]=O("layout-shift",C),n.i&&O("element",H)),void 0!==i.hidden&&i.addEventListener("visibilitychange",d.bind(this,R));var u=function(){if(!a())return{};var n=o.getEntriesByType("navigation")[0];if(!n)return{};var t=n.responseStart,e=n.responseEnd;return{fetchTime:e-n.fetchStart,workerTime:n.workerStart>0?e-n.workerStart:0,totalTime:e-n.requestStart,downloadTime:e-t,timeToFirstByte:t-n.requestStart,headerSize:n.transferSize-n.encodedBodySize||0,dnsLookupTime:n.domainLookupEnd-n.domainLookupStart,redirectTime:n.redirectEnd-n.redirectStart}}();_("navigationTiming",u),u.timeToFirstByte&&F(u.timeToFirstByte,"ttfb"),_("networkInformation",function(){if("connection"in r){var n=r.connection;return"object"!=typeof n?{}:(f=n.effectiveType,s=!!n.saveData,{downlink:n.downlink,effectiveType:n.effectiveType,rtt:n.rtt,saveData:!!n.saveData})}return{}}()),r&&r.storage&&"function"==typeof r.storage.estimate&&r.storage.estimate().then(A)}}return e.prototype.start=function(n){a()&&!E[n]&&(E[n]=!0,o.mark("mark_"+n+"_start"),v.u=!1)},e.prototype.end=function(n,t,e){if(void 0===t&&(t={}),void 0===e&&(e=!0),a()&&E[n]){o.mark("mark_"+n+"_end"),delete E[n];var i=function(n){o.measure(n,"mark_"+n+"_start","mark_"+n+"_end");var t=o.getEntriesByName(n).pop();return t&&"measure"===t.entryType?t.duration:-1}(n);e&&_(n,p(i),t)}},e.prototype.endPaint=function(n,t){var e=this;setTimeout((function(){e.end(n,t)}))},e.prototype.clear=function(n){delete E[n],o.clearMarks&&(o.clearMarks("mark_"+n+"_start"),o.clearMarks("mark_"+n+"_end"))},e.prototype.markNTBT=function(){var n=this;this.start("ntbt"),q.value=0,clearTimeout(G),G=setTimeout((function(){n.end("ntbt",{},!1),F(q.value,"ntbt"),q.value=0}),2e3)},e}()}();
//# sourceMappingURL=perfume.iife.min.js.map

@@ -1,2 +0,2 @@

"use strict";var n={t:!1,i:!1,o:3e4},t=window,e=t.console,i=document,r=t.navigator,o=t.performance,u=function(){return r.deviceMemory},c=function(){return r.hardwareConcurrency},a=function(){return o&&!!o.getEntriesByType&&!!o.now&&!!o.mark},f="4g",s=!1,l=function(){return!!(c()&&c()<=4)||!!(u()&&u()<=4)},m=function(n,t){switch(n){case"slow-2g":case"2g":case"3g":return!0;default:return l()||t}},v={u:!1},d=function(n){i.hidden&&(n(),v.u=i.hidden)},p=function(n){return parseFloat(n.toFixed(4))},g=function(n){return"number"!=typeof n?null:p(n/Math.pow(1024,2))},b=[2e3,4e3],h=[2500,4e3],T=[.1,.25],k={ttfb:[200,500],fp:b,fcp:b,lcp:h,lcpFinal:h,fid:[100,300],cls:T,clsFinal:T,tbt:[300,600],ntbt:[400,600]},y=function(n,t){return k[n]?t<=k[n][0]?"good":t<=k[n][1]?"needsImprovement":"poor":null},w=function(e,i,o){var a;a=function(){v.u&&e.indexOf("Final")<0||!n.analyticsTracker||n.analyticsTracker({metricName:e,data:i,eventProperties:o||{},navigatorInformation:r?{deviceMemory:u()||0,hardwareConcurrency:c()||0,serviceWorkerStatus:"serviceWorker"in r?r.serviceWorker.controller?"controlled":"supported":"unsupported",isLowEndDevice:l(),isLowEndExperience:m(f,s)}:{},vitalsScore:y(e,i)})},"requestIdleCallback"in t?t.requestIdleCallback(a,{timeout:3e3}):a()},_=function(n,t,e){Object.keys(t).forEach((function(n){"number"==typeof t[n]&&(t[n]=p(t[n]))})),w(n,t,e)},F=function(t,e,i){var r=p(t);r<=n.o&&r>=0&&w(e,r,i)},E={},x={value:0},D={value:0},I={value:0},P={value:{beacon:0,css:0,fetch:0,img:0,other:0,script:0,total:0,xmlhttprequest:0}},j={value:0},q={value:0},C=function(n){var t=n.pop();t&&!t.s&&t.value&&(x.value+=t.value)},L={},O=function(n,t){try{var i=new PerformanceObserver((function(n){t(n.getEntries())}));return i.observe({type:n,buffered:!0}),i}catch(n){e.warn("Perfume.js:",n)}return null},S=function(n){L[n]&&L[n].disconnect(),delete L[n]},W=function(n){var t=n.pop();t&&F(t.processingStart-t.startTime,"fid",{performanceEntry:t}),S(1),F(I.value,"lcp"),L[3]&&"function"==typeof L[3].takeRecords&&L[3].takeRecords(),F(x.value,"cls"),setTimeout((function(){F(j.value,"tbt"),_("dataConsumption",P.value)}),1e4)},B=function(n){n.forEach((function(n){if(!("self"!==n.name||n.startTime<D.value)){var t=n.duration-50;t>0&&(j.value+=t,q.value+=t)}}))},M=function(n){n.forEach((function(n){"first-paint"===n.name?F(n.startTime,"fp"):"first-contentful-paint"===n.name&&(D.value=n.startTime,F(D.value,"fcp"),L[4]=O("longtask",B),S(0))}))},z=function(n){var t=n.pop();t&&(I.value=t.renderTime||t.loadTime)},H=function(n){n.forEach((function(n){n.identifier&&F(n.startTime,n.identifier)}))},N=function(t){t.forEach((function(t){if(n.t&&_("resourceTiming",t),t.decodedBodySize&&t.initiatorType){var e=t.decodedBodySize/1e3;P.value[t.initiatorType]+=e,P.value.total+=e}}))},R=function(){L[2]&&(F(I.value,"lcpFinal"),S(2)),L[3]&&("function"==typeof L[3].takeRecords&&L[3].takeRecords(),F(x.value,"clsFinal"),S(3))},A=function(n){var t="usageDetails"in n?n.usageDetails:{};_("storageEstimate",{quota:g(n.quota),usage:g(n.usage),caches:g(t.caches),indexedDB:g(t.indexedDB),serviceWorker:g(t.serviceWorkerRegistrations)})},G=0,J=function(){function e(e){if(void 0===e&&(e={}),this.l="6.4.0",n.analyticsTracker=e.analyticsTracker,n.t=!!e.resourceTiming,n.i=!!e.elementTiming,n.o=e.maxMeasureTime||n.o,a()){"PerformanceObserver"in t&&(L[0]=O("paint",M),L[1]=O("first-input",W),L[2]=O("largest-contentful-paint",z),n.t&&O("resource",N),L[3]=O("layout-shift",C),n.i&&O("element",H)),void 0!==i.hidden&&i.addEventListener("visibilitychange",d.bind(this,R));var u=function(){if(!a())return{};var n=o.getEntriesByType("navigation")[0];if(!n)return{};var t=n.responseStart,e=n.responseEnd;return{fetchTime:e-n.fetchStart,workerTime:n.workerStart>0?e-n.workerStart:0,totalTime:e-n.requestStart,downloadTime:e-t,timeToFirstByte:t-n.requestStart,headerSize:n.transferSize-n.encodedBodySize||0,dnsLookupTime:n.domainLookupEnd-n.domainLookupStart,redirectTime:n.redirectEnd-n.redirectStart}}();_("navigationTiming",u),u.timeToFirstByte&&F(u.timeToFirstByte,"ttfb"),_("networkInformation",function(){if("connection"in r){var n=r.connection;return"object"!=typeof n?{}:(f=n.effectiveType,s=!!n.saveData,{downlink:n.downlink,effectiveType:n.effectiveType,rtt:n.rtt,saveData:!!n.saveData})}return{}}()),r&&r.storage&&"function"==typeof r.storage.estimate&&r.storage.estimate().then(A)}}return e.prototype.start=function(n){a()&&!E[n]&&(E[n]=!0,o.mark("mark_"+n+"_start"),v.u=!1)},e.prototype.end=function(n,t,e){if(void 0===t&&(t={}),void 0===e&&(e=!0),a()&&E[n]){o.mark("mark_"+n+"_end"),delete E[n];var i=function(n){o.measure(n,"mark_"+n+"_start","mark_"+n+"_end");var t=o.getEntriesByName(n).pop();return t&&"measure"===t.entryType?t.duration:-1}(n);e&&_(n,p(i),t)}},e.prototype.endPaint=function(n,t){var e=this;setTimeout((function(){e.end(n,t)}))},e.prototype.clear=function(n){delete E[n],o.clearMarks&&(o.clearMarks("mark_"+n+"_start"),o.clearMarks("mark_"+n+"_end"))},e.prototype.markNTBT=function(){var n=this;this.start("ntbt"),q.value=0,clearTimeout(G),G=setTimeout((function(){n.end("ntbt",{},!1),F(q.value,"ntbt"),q.value=0}),2e3)},e}();module.exports=J;
"use strict";var n={t:!1,i:!1,o:3e4},t=window,e=t.console,i=document,r=t.navigator,o=t.performance,u=function(){return r.deviceMemory},c=function(){return r.hardwareConcurrency},a=function(){return o&&!!o.getEntriesByType&&!!o.now&&!!o.mark},f="4g",s=!1,l=function(){return!!(c()&&c()<=4)||!!(u()&&u()<=4)},m=function(n,t){switch(n){case"slow-2g":case"2g":case"3g":return!0;default:return l()||t}},v={u:!1},d=function(n){i.hidden&&(n(),v.u=i.hidden)},p=function(n){return parseFloat(n.toFixed(4))},g=function(n){return"number"!=typeof n?null:p(n/Math.pow(1024,2))},b=[2e3,4e3],h=[2500,4e3],T=[.1,.25],k={ttfb:[200,500],fp:b,fcp:b,lcp:h,lcpFinal:h,fid:[100,300],cls:T,clsFinal:T,tbt:[200,600],ntbt:[200,600]},y=function(n,t){return k[n]?t<=k[n][0]?"good":t<=k[n][1]?"needsImprovement":"poor":null},w=function(e,i,o){var a;a=function(){v.u&&e.indexOf("Final")<0||!n.analyticsTracker||n.analyticsTracker({metricName:e,data:i,eventProperties:o||{},navigatorInformation:r?{deviceMemory:u()||0,hardwareConcurrency:c()||0,serviceWorkerStatus:"serviceWorker"in r?r.serviceWorker.controller?"controlled":"supported":"unsupported",isLowEndDevice:l(),isLowEndExperience:m(f,s)}:{},vitalsScore:y(e,i)})},"requestIdleCallback"in t?t.requestIdleCallback(a,{timeout:3e3}):a()},_=function(n,t,e){Object.keys(t).forEach((function(n){"number"==typeof t[n]&&(t[n]=p(t[n]))})),w(n,t,e)},F=function(t,e,i){var r=p(t);r<=n.o&&r>=0&&w(e,r,i)},E={},x={value:0},D={value:0},I={value:0},P={value:{beacon:0,css:0,fetch:0,img:0,other:0,script:0,total:0,xmlhttprequest:0}},j={value:0},q={value:0},C=function(n){var t=n.pop();t&&!t.s&&t.value&&(x.value+=t.value)},L={},O=function(n,t){try{var i=new PerformanceObserver((function(n){t(n.getEntries())}));return i.observe({type:n,buffered:!0}),i}catch(n){e.warn("Perfume.js:",n)}return null},S=function(n){L[n]&&L[n].disconnect(),delete L[n]},W=function(n){var t=n.pop();t&&F(t.processingStart-t.startTime,"fid",{performanceEntry:t}),S(1),F(I.value,"lcp"),L[3]&&"function"==typeof L[3].takeRecords&&L[3].takeRecords(),F(x.value,"cls"),setTimeout((function(){F(j.value,"tbt"),_("dataConsumption",P.value)}),1e4)},B=function(n){n.forEach((function(n){if(!("self"!==n.name||n.startTime<D.value)){var t=n.duration-50;t>0&&(j.value+=t,q.value+=t)}}))},M=function(n){n.forEach((function(n){"first-paint"===n.name?F(n.startTime,"fp"):"first-contentful-paint"===n.name&&(D.value=n.startTime,F(D.value,"fcp"),L[4]=O("longtask",B),S(0))}))},z=function(n){var t=n.pop();t&&(I.value=t.renderTime||t.loadTime)},H=function(n){n.forEach((function(n){n.identifier&&F(n.startTime,n.identifier)}))},N=function(t){t.forEach((function(t){if(n.t&&_("resourceTiming",t),t.decodedBodySize&&t.initiatorType){var e=t.decodedBodySize/1e3;P.value[t.initiatorType]+=e,P.value.total+=e}}))},R=function(){L[2]&&(F(I.value,"lcpFinal"),S(2)),L[3]&&("function"==typeof L[3].takeRecords&&L[3].takeRecords(),F(x.value,"clsFinal"),S(3))},A=function(n){var t="usageDetails"in n?n.usageDetails:{};_("storageEstimate",{quota:g(n.quota),usage:g(n.usage),caches:g(t.caches),indexedDB:g(t.indexedDB),serviceWorker:g(t.serviceWorkerRegistrations)})},G=0,J=function(){function e(e){if(void 0===e&&(e={}),this.l="7.0.0",n.analyticsTracker=e.analyticsTracker,n.t=!!e.resourceTiming,n.i=!!e.elementTiming,n.o=e.maxMeasureTime||n.o,a()){"PerformanceObserver"in t&&(L[0]=O("paint",M),L[1]=O("first-input",W),L[2]=O("largest-contentful-paint",z),n.t&&O("resource",N),L[3]=O("layout-shift",C),n.i&&O("element",H)),void 0!==i.hidden&&i.addEventListener("visibilitychange",d.bind(this,R));var u=function(){if(!a())return{};var n=o.getEntriesByType("navigation")[0];if(!n)return{};var t=n.responseStart,e=n.responseEnd;return{fetchTime:e-n.fetchStart,workerTime:n.workerStart>0?e-n.workerStart:0,totalTime:e-n.requestStart,downloadTime:e-t,timeToFirstByte:t-n.requestStart,headerSize:n.transferSize-n.encodedBodySize||0,dnsLookupTime:n.domainLookupEnd-n.domainLookupStart,redirectTime:n.redirectEnd-n.redirectStart}}();_("navigationTiming",u),u.timeToFirstByte&&F(u.timeToFirstByte,"ttfb"),_("networkInformation",function(){if("connection"in r){var n=r.connection;return"object"!=typeof n?{}:(f=n.effectiveType,s=!!n.saveData,{downlink:n.downlink,effectiveType:n.effectiveType,rtt:n.rtt,saveData:!!n.saveData})}return{}}()),r&&r.storage&&"function"==typeof r.storage.estimate&&r.storage.estimate().then(A)}}return e.prototype.start=function(n){a()&&!E[n]&&(E[n]=!0,o.mark("mark_"+n+"_start"),v.u=!1)},e.prototype.end=function(n,t,e){if(void 0===t&&(t={}),void 0===e&&(e=!0),a()&&E[n]){o.mark("mark_"+n+"_end"),delete E[n];var i=function(n){o.measure(n,"mark_"+n+"_start","mark_"+n+"_end");var t=o.getEntriesByName(n).pop();return t&&"measure"===t.entryType?t.duration:-1}(n);e&&_(n,p(i),t)}},e.prototype.endPaint=function(n,t){var e=this;setTimeout((function(){e.end(n,t)}))},e.prototype.clear=function(n){delete E[n],o.clearMarks&&(o.clearMarks("mark_"+n+"_start"),o.clearMarks("mark_"+n+"_end"))},e.prototype.markNTBT=function(){var n=this;this.start("ntbt"),q.value=0,clearTimeout(G),G=setTimeout((function(){n.end("ntbt",{},!1),F(q.value,"ntbt"),q.value=0}),2e3)},e}();module.exports=J;
//# sourceMappingURL=perfume.min.js.map

@@ -1,2 +0,2 @@

!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n=n||self).Perfume=t()}(this,(function(){"use strict";var n={t:!1,i:!1,o:3e4},t=window,e=t.console,i=document,r=t.navigator,o=t.performance,u=function(){return r.deviceMemory},c=function(){return r.hardwareConcurrency},f=function(){return o&&!!o.getEntriesByType&&!!o.now&&!!o.mark},a="4g",s=!1,l=function(){return!!(c()&&c()<=4)||!!(u()&&u()<=4)},m=function(n,t){switch(n){case"slow-2g":case"2g":case"3g":return!0;default:return l()||t}},d={u:!1},v=function(n){i.hidden&&(n(),d.u=i.hidden)},p=function(n){return parseFloat(n.toFixed(4))},b=function(n){return"number"!=typeof n?null:p(n/Math.pow(1024,2))},g=[2e3,4e3],h=[2500,4e3],y=[.1,.25],T={ttfb:[200,500],fp:g,fcp:g,lcp:h,lcpFinal:h,fid:[100,300],cls:y,clsFinal:y,tbt:[300,600],ntbt:[400,600]},k=function(n,t){return T[n]?t<=T[n][0]?"good":t<=T[n][1]?"needsImprovement":"poor":null},w=function(e,i,o){var f;f=function(){d.u&&e.indexOf("Final")<0||!n.analyticsTracker||n.analyticsTracker({metricName:e,data:i,eventProperties:o||{},navigatorInformation:r?{deviceMemory:u()||0,hardwareConcurrency:c()||0,serviceWorkerStatus:"serviceWorker"in r?r.serviceWorker.controller?"controlled":"supported":"unsupported",isLowEndDevice:l(),isLowEndExperience:m(a,s)}:{},vitalsScore:k(e,i)})},"requestIdleCallback"in t?t.requestIdleCallback(f,{timeout:3e3}):f()},_=function(n,t,e){Object.keys(t).forEach((function(n){"number"==typeof t[n]&&(t[n]=p(t[n]))})),w(n,t,e)},F=function(t,e,i){var r=p(t);r<=n.o&&r>=0&&w(e,r,i)},E={},x={value:0},j={value:0},D={value:0},I={value:{beacon:0,css:0,fetch:0,img:0,other:0,script:0,total:0,xmlhttprequest:0}},P={value:0},q={value:0},C=function(n){var t=n.pop();t&&!t.s&&t.value&&(x.value+=t.value)},L={},O=function(n,t){try{var i=new PerformanceObserver((function(n){t(n.getEntries())}));return i.observe({type:n,buffered:!0}),i}catch(n){e.warn("Perfume.js:",n)}return null},S=function(n){L[n]&&L[n].disconnect(),delete L[n]},W=function(n){var t=n.pop();t&&F(t.processingStart-t.startTime,"fid",{performanceEntry:t}),S(1),F(D.value,"lcp"),L[3]&&"function"==typeof L[3].takeRecords&&L[3].takeRecords(),F(x.value,"cls"),setTimeout((function(){F(P.value,"tbt"),_("dataConsumption",I.value)}),1e4)},B=function(n){n.forEach((function(n){if(!("self"!==n.name||n.startTime<j.value)){var t=n.duration-50;t>0&&(P.value+=t,q.value+=t)}}))},M=function(n){n.forEach((function(n){"first-paint"===n.name?F(n.startTime,"fp"):"first-contentful-paint"===n.name&&(j.value=n.startTime,F(j.value,"fcp"),L[4]=O("longtask",B),S(0))}))},z=function(n){var t=n.pop();t&&(D.value=t.renderTime||t.loadTime)},H=function(n){n.forEach((function(n){n.identifier&&F(n.startTime,n.identifier)}))},N=function(t){t.forEach((function(t){if(n.t&&_("resourceTiming",t),t.decodedBodySize&&t.initiatorType){var e=t.decodedBodySize/1e3;I.value[t.initiatorType]+=e,I.value.total+=e}}))},R=function(){L[2]&&(F(D.value,"lcpFinal"),S(2)),L[3]&&("function"==typeof L[3].takeRecords&&L[3].takeRecords(),F(x.value,"clsFinal"),S(3))},A=function(n){var t="usageDetails"in n?n.usageDetails:{};_("storageEstimate",{quota:b(n.quota),usage:b(n.usage),caches:b(t.caches),indexedDB:b(t.indexedDB),serviceWorker:b(t.serviceWorkerRegistrations)})},G=0;return function(){function e(e){if(void 0===e&&(e={}),this.l="6.4.0",n.analyticsTracker=e.analyticsTracker,n.t=!!e.resourceTiming,n.i=!!e.elementTiming,n.o=e.maxMeasureTime||n.o,f()){"PerformanceObserver"in t&&(L[0]=O("paint",M),L[1]=O("first-input",W),L[2]=O("largest-contentful-paint",z),n.t&&O("resource",N),L[3]=O("layout-shift",C),n.i&&O("element",H)),void 0!==i.hidden&&i.addEventListener("visibilitychange",v.bind(this,R));var u=function(){if(!f())return{};var n=o.getEntriesByType("navigation")[0];if(!n)return{};var t=n.responseStart,e=n.responseEnd;return{fetchTime:e-n.fetchStart,workerTime:n.workerStart>0?e-n.workerStart:0,totalTime:e-n.requestStart,downloadTime:e-t,timeToFirstByte:t-n.requestStart,headerSize:n.transferSize-n.encodedBodySize||0,dnsLookupTime:n.domainLookupEnd-n.domainLookupStart,redirectTime:n.redirectEnd-n.redirectStart}}();_("navigationTiming",u),u.timeToFirstByte&&F(u.timeToFirstByte,"ttfb"),_("networkInformation",function(){if("connection"in r){var n=r.connection;return"object"!=typeof n?{}:(a=n.effectiveType,s=!!n.saveData,{downlink:n.downlink,effectiveType:n.effectiveType,rtt:n.rtt,saveData:!!n.saveData})}return{}}()),r&&r.storage&&"function"==typeof r.storage.estimate&&r.storage.estimate().then(A)}}return e.prototype.start=function(n){f()&&!E[n]&&(E[n]=!0,o.mark("mark_"+n+"_start"),d.u=!1)},e.prototype.end=function(n,t,e){if(void 0===t&&(t={}),void 0===e&&(e=!0),f()&&E[n]){o.mark("mark_"+n+"_end"),delete E[n];var i=function(n){o.measure(n,"mark_"+n+"_start","mark_"+n+"_end");var t=o.getEntriesByName(n).pop();return t&&"measure"===t.entryType?t.duration:-1}(n);e&&_(n,p(i),t)}},e.prototype.endPaint=function(n,t){var e=this;setTimeout((function(){e.end(n,t)}))},e.prototype.clear=function(n){delete E[n],o.clearMarks&&(o.clearMarks("mark_"+n+"_start"),o.clearMarks("mark_"+n+"_end"))},e.prototype.markNTBT=function(){var n=this;this.start("ntbt"),q.value=0,clearTimeout(G),G=setTimeout((function(){n.end("ntbt",{},!1),F(q.value,"ntbt"),q.value=0}),2e3)},e}()}));
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n=n||self).Perfume=t()}(this,(function(){"use strict";var n={t:!1,i:!1,o:3e4},t=window,e=t.console,i=document,r=t.navigator,o=t.performance,u=function(){return r.deviceMemory},c=function(){return r.hardwareConcurrency},f=function(){return o&&!!o.getEntriesByType&&!!o.now&&!!o.mark},a="4g",s=!1,l=function(){return!!(c()&&c()<=4)||!!(u()&&u()<=4)},m=function(n,t){switch(n){case"slow-2g":case"2g":case"3g":return!0;default:return l()||t}},d={u:!1},v=function(n){i.hidden&&(n(),d.u=i.hidden)},p=function(n){return parseFloat(n.toFixed(4))},b=function(n){return"number"!=typeof n?null:p(n/Math.pow(1024,2))},g=[2e3,4e3],h=[2500,4e3],y=[.1,.25],T={ttfb:[200,500],fp:g,fcp:g,lcp:h,lcpFinal:h,fid:[100,300],cls:y,clsFinal:y,tbt:[200,600],ntbt:[200,600]},k=function(n,t){return T[n]?t<=T[n][0]?"good":t<=T[n][1]?"needsImprovement":"poor":null},w=function(e,i,o){var f;f=function(){d.u&&e.indexOf("Final")<0||!n.analyticsTracker||n.analyticsTracker({metricName:e,data:i,eventProperties:o||{},navigatorInformation:r?{deviceMemory:u()||0,hardwareConcurrency:c()||0,serviceWorkerStatus:"serviceWorker"in r?r.serviceWorker.controller?"controlled":"supported":"unsupported",isLowEndDevice:l(),isLowEndExperience:m(a,s)}:{},vitalsScore:k(e,i)})},"requestIdleCallback"in t?t.requestIdleCallback(f,{timeout:3e3}):f()},_=function(n,t,e){Object.keys(t).forEach((function(n){"number"==typeof t[n]&&(t[n]=p(t[n]))})),w(n,t,e)},F=function(t,e,i){var r=p(t);r<=n.o&&r>=0&&w(e,r,i)},E={},x={value:0},j={value:0},D={value:0},I={value:{beacon:0,css:0,fetch:0,img:0,other:0,script:0,total:0,xmlhttprequest:0}},P={value:0},q={value:0},C=function(n){var t=n.pop();t&&!t.s&&t.value&&(x.value+=t.value)},L={},O=function(n,t){try{var i=new PerformanceObserver((function(n){t(n.getEntries())}));return i.observe({type:n,buffered:!0}),i}catch(n){e.warn("Perfume.js:",n)}return null},S=function(n){L[n]&&L[n].disconnect(),delete L[n]},W=function(n){var t=n.pop();t&&F(t.processingStart-t.startTime,"fid",{performanceEntry:t}),S(1),F(D.value,"lcp"),L[3]&&"function"==typeof L[3].takeRecords&&L[3].takeRecords(),F(x.value,"cls"),setTimeout((function(){F(P.value,"tbt"),_("dataConsumption",I.value)}),1e4)},B=function(n){n.forEach((function(n){if(!("self"!==n.name||n.startTime<j.value)){var t=n.duration-50;t>0&&(P.value+=t,q.value+=t)}}))},M=function(n){n.forEach((function(n){"first-paint"===n.name?F(n.startTime,"fp"):"first-contentful-paint"===n.name&&(j.value=n.startTime,F(j.value,"fcp"),L[4]=O("longtask",B),S(0))}))},z=function(n){var t=n.pop();t&&(D.value=t.renderTime||t.loadTime)},H=function(n){n.forEach((function(n){n.identifier&&F(n.startTime,n.identifier)}))},N=function(t){t.forEach((function(t){if(n.t&&_("resourceTiming",t),t.decodedBodySize&&t.initiatorType){var e=t.decodedBodySize/1e3;I.value[t.initiatorType]+=e,I.value.total+=e}}))},R=function(){L[2]&&(F(D.value,"lcpFinal"),S(2)),L[3]&&("function"==typeof L[3].takeRecords&&L[3].takeRecords(),F(x.value,"clsFinal"),S(3))},A=function(n){var t="usageDetails"in n?n.usageDetails:{};_("storageEstimate",{quota:b(n.quota),usage:b(n.usage),caches:b(t.caches),indexedDB:b(t.indexedDB),serviceWorker:b(t.serviceWorkerRegistrations)})},G=0;return function(){function e(e){if(void 0===e&&(e={}),this.l="7.0.0",n.analyticsTracker=e.analyticsTracker,n.t=!!e.resourceTiming,n.i=!!e.elementTiming,n.o=e.maxMeasureTime||n.o,f()){"PerformanceObserver"in t&&(L[0]=O("paint",M),L[1]=O("first-input",W),L[2]=O("largest-contentful-paint",z),n.t&&O("resource",N),L[3]=O("layout-shift",C),n.i&&O("element",H)),void 0!==i.hidden&&i.addEventListener("visibilitychange",v.bind(this,R));var u=function(){if(!f())return{};var n=o.getEntriesByType("navigation")[0];if(!n)return{};var t=n.responseStart,e=n.responseEnd;return{fetchTime:e-n.fetchStart,workerTime:n.workerStart>0?e-n.workerStart:0,totalTime:e-n.requestStart,downloadTime:e-t,timeToFirstByte:t-n.requestStart,headerSize:n.transferSize-n.encodedBodySize||0,dnsLookupTime:n.domainLookupEnd-n.domainLookupStart,redirectTime:n.redirectEnd-n.redirectStart}}();_("navigationTiming",u),u.timeToFirstByte&&F(u.timeToFirstByte,"ttfb"),_("networkInformation",function(){if("connection"in r){var n=r.connection;return"object"!=typeof n?{}:(a=n.effectiveType,s=!!n.saveData,{downlink:n.downlink,effectiveType:n.effectiveType,rtt:n.rtt,saveData:!!n.saveData})}return{}}()),r&&r.storage&&"function"==typeof r.storage.estimate&&r.storage.estimate().then(A)}}return e.prototype.start=function(n){f()&&!E[n]&&(E[n]=!0,o.mark("mark_"+n+"_start"),d.u=!1)},e.prototype.end=function(n,t,e){if(void 0===t&&(t={}),void 0===e&&(e=!0),f()&&E[n]){o.mark("mark_"+n+"_end"),delete E[n];var i=function(n){o.measure(n,"mark_"+n+"_start","mark_"+n+"_end");var t=o.getEntriesByName(n).pop();return t&&"measure"===t.entryType?t.duration:-1}(n);e&&_(n,p(i),t)}},e.prototype.endPaint=function(n,t){var e=this;setTimeout((function(){e.end(n,t)}))},e.prototype.clear=function(n){delete E[n],o.clearMarks&&(o.clearMarks("mark_"+n+"_start"),o.clearMarks("mark_"+n+"_end"))},e.prototype.markNTBT=function(){var n=this;this.start("ntbt"),q.value=0,clearTimeout(G),G=setTimeout((function(){n.end("ntbt",{},!1),F(q.value,"ntbt"),q.value=0}),2e3)},e}()}));
//# sourceMappingURL=perfume.umd.min.js.map
{
"name": "perfume.js",
"version": "6.4.0",
"version": "7.0.0",
"description": "Web performance library for measuring all User-centric performance metrics, including the latest Web Vitals.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -6,3 +6,3 @@ <a href="http://www.perfumejs.com/">

# [Perfume.js v6.4.0](http://perfumejs.com)
# [Perfume.js v7.0.0](http://perfumejs.com)

@@ -50,2 +50,3 @@ [![Current version](https://img.shields.io/github/tag/zizzamia/perfume.js?color=3498DB&label=version)](https://www.npmjs.org/package/perfume.js) [![Test Coverage](https://api.codeclimate.com/v1/badges/f813d2f45b274d93b8c5/test_coverage)](https://codeclimate.com/github/Zizzamia/perfume.js/test_coverage) <img alt="No dependencies" src="https://img.shields.io/badge/dependencies-none-27ae60.svg"> [![Build Status](https://travis-ci.org/Zizzamia/perfume.js.svg?branch=master)](https://travis-ci.org/Zizzamia/perfume.js) [![NPM Downloads](http://img.shields.io/npm/dm/perfume.js.svg)](https://www.npmjs.org/package/perfume.js) [![gzip size](https://img.badgesize.io/https://unpkg.com/perfume.js?compression=gzip&label=JS+gzip+size)](https://unpkg.com/perfume.js) [![brotli size](https://img.badgesize.io/https://unpkg.com/perfume.js?compression=brotli&label=JS+brotli+size)](https://unpkg.com/perfume.js)

- Total Blocking Time ([TBT](https://web.dev/tbt/))
- Navigation Total Blocking Time (NTBT)
- [Web Vitals Score](https://web.dev/vitals/)

@@ -241,2 +242,29 @@

### Navigation Total Blocking Time (NTBT)
This metric measures the amount of time the application may be blocked from processing code during the 2s window after a user navigates from page A to page B. The NTBT metric is the summation of the blocking time of all long tasks in the 2s window after this method is invoked.
Because this library is navigation agnostic, we have this method to mark when the navigation starts.
If this method is called before the 2s window ends; it will trigger a new NTBT measurement and interrupt the previous one.
```javascript
import { createBrowserHistory } from 'history';
export const history = createBrowserHistory();
const perfume = new Perfume({
analyticsTracker: ({ metricName, data }) => {
myAnalyticsTool.track(metricName, data);
})
});
// React custom history
history.listen(() => {
// Measure NTBT at the beginning of each navigation
perfume.markNTBT();
});
// Perfume.js: ntbt 78 ms
```
### Resource Timing

@@ -331,3 +359,4 @@

| Cumulative Layout Shift Final (clsFinal) | 0-2500 | 2501-4000 | Over 4000 |
| Total Blocking Time (tbt) | 0-300 | 301-600 | Over 600 |
| Total Blocking Time (tbt) | 0-200 | 201-600 | Over 600 |
| Navigation Total Blocking Time (tbt) | 0-200 | 201-600 | Over 600 |

@@ -334,0 +363,0 @@ ## Perfume custom options

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc