PageSourceSearch

https://juicycouture.com/cdn/shop/t/1044/assets/web-vitals.js?v=41073462801500332541789137806

js juicycouture.com collected 2026-09-24 17:45:19 UTC 7,078 bytes, 2 lines download raw bytes

1const vitals={},inputVitals={};let pushedInputToDataLayer=!1,domLoadedTimeSet=!1,domLoadedTimeValue=0,longTasks=[],fcpTime=0,networkRequestCount=0,networkRequests=new Map,ttiCalculated=!1;const handleVitals=(name,value,eventType)=>{switch(eventType){case"web_vitals":vitals[name]=value,name==="DOMLoadedTime"&&(domLoadedTimeSet=!0,domLoadedTimeValue=value),name==="FCP"&&(fcpTime=parseFloat(value));break;case"performance_input_web_vitals":inputVitals[name]||(inputVitals[name]=value),Object.keys(inputVitals).length===2&&!pushedInputToDataLayer&&(window.dataLayer.push({event:eventType,data_vitals:inputVitals}),pushedInputToDataLayer=!0);break;default:break}},getNetworkInformation=()=>{let networkInfo={};const{connection}=navigator;return connection&&(networkInfo={downlink:connection.downlink?connection.downlink:"",downlink_max:connection.downlinkMax?connection.downlinkMax:"",effective_type:connection.effectiveType?connection.effectiveType:"",round_trip_time:connection.rtt?connection.rtt:"",save_data:connection.saveData!==void 0?connection.saveData:"",type:connection.type?connection.type:""}),networkInfo},setupNetworkTracking=()=>{let requestId=0;const originalFetch=window.fetch;window.fetch=function(){const currentId=requestId++;return networkRequestCount++,networkRequests.set(currentId,performance.now()),originalFetch.apply(this,arguments).then(response=>(networkRequestCount--,networkRequests.delete(currentId),response)).catch(error=>{throw networkRequestCount--,networkRequests.delete(currentId),error})};const originalOpen=XMLHttpRequest.prototype.open,originalSend=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(){return this._ttiRequestId=requestId++,originalOpen.apply(this,arguments)},XMLHttpRequest.prototype.send=function(){return networkRequestCount++,networkRequests.set(this._ttiRequestId,performance.now()),this.addEventListener("readystatechange",()=>{this.readyState===4&&(networkRequestCount--,networkRequests.delete(this._ttiRequestId))}),originalSend.apply(this,arguments)}},calculateTTI=()=>{if(ttiCalculated||fcpTime===0)return vitals.TTI||0;if(!fcpTime){const navigationTiming2=performance.getEntriesByType("navigation")[0];if(navigationTiming2)fcpTime=navigationTiming2.domContentLoadedEventEnd;else return 0}const sortedTasks=[...longTasks].sort((a,b)=>a.startTime-b.startTime),tasksAfterFCP=sortedTasks.filter(task=>task.startTime>=fcpTime);if(tasksAfterFCP.length===0&&networkRequestCount<=2)return ttiCalculated=!0,fcpTime;const QUIET_WINDOW=5e3;let quietWindowStart=0,checkTime=fcpTime;if(tasksAfterFCP.length>0){const lastTask=tasksAfterFCP[tasksAfterFCP.length-1];checkTime=lastTask.startTime+lastTask.duration}if(performance.now()-checkTime>=QUIET_WINDOW&&networkRequestCount<=2&&(quietWindowStart=checkTime),quietWindowStart>0){const lastTaskBeforeQuiet=sortedTasks.filter(task=>task.startTime+task.duration<=quietWindowStart).pop();if(lastTaskBeforeQuiet){const tti=lastTaskBeforeQuiet.startTime+lastTaskBeforeQuiet.duration;return ttiCalculated=!0,Math.max(tti,fcpTime)}else return ttiCalculated=!0,fcpTime}const domContentLoaded=performance.getEntriesByType("navigation")[0].domContentLoadedEventEnd,firstInput=performance.getEntriesByType("first-input")[0];return firstInput?firstInput.startTime:domContentLoaded},getDOMLoadedTime=()=>{try{const navigationEntries=performance.getEntriesByType("navigation");if(navigationEntries&&navigationEntries.length>0){const navigationTiming=navigationEntries[0];return Math.round(navigationTiming.domContentLoadedEventEnd)}if(performance.getEntriesByType&&performance.getEntriesByType("navigation").length>0){const navEntry=performance.getEntriesByType("navigation")[0];return Math.round(navEntry.domContentLoadedEventEnd)}return Math.round(performance.now())}catch(e){console.error("Error calculating DOMLoadedTime:",e)}return 0},getUrlInfo=()=>({full_url:window.location.href,url_without_query:window.location.origin+window.location.pathname}),executeVitalsListeners=()=>{try{new PerformanceObserver(entries=>{entries.getEntries().forEach(entry=>{longTasks.push({startTime:entry.startTime,duration:entry.duration})})}).observe({entryTypes:["longtask"]})}catch(e){console.warn("Long Task API not supported",e)}setupNetworkTracking();let domContentLoadedTime=0;document.addEventListener("DOMContentLoaded",()=>{domContentLoadedTime=performance.now(),domLoadedTimeValue=domContentLoadedTime,domLoadedTimeSet
1=!0,vitals.DOMLoadedTime=domContentLoadedTime;const apiDomLoadedTime=getDOMLoadedTime();apiDomLoadedTime>0&&!domLoadedTimeValue&&(domLoadedTimeValue=apiDomLoadedTime,domLoadedTimeSet=!0,vitals.DOMLoadedTime=apiDomLoadedTime)});const performanceObserver=new PerformanceObserver(entryList=>{entryList.getEntries().forEach(entry=>{if(entry.entryType)switch(entry.entryType){case"layout-shift":handleVitals("CLS",entry.value,"web_vitals");break;case"first-input":handleVitals("FID",`${entry.duration}`,"performance_input_web_vitals");break;case"largest-contentful-paint":handleVitals("LCP",`${entry.startTime}`,"web_vitals");break;case"paint":entry.name==="first-contentful-paint"&&(handleVitals("FCP",`${entry.startTime}`,"web_vitals"),fcpTime=entry.startTime);break;case"navigation":{const[pageNav]=entryList.getEntriesByType("navigation");if(handleVitals("TTFB",`${pageNav.responseStart}`,"web_vitals"),pageNav.domContentLoadedEventEnd){const domLoadTime=Math.round(pageNav.domContentLoadedEventEnd);domLoadTime>0&&(vitals.DOMLoadedTime=domLoadTime,domLoadedTimeSet=!0,domLoadedTimeValue=domLoadTime)}break}case"event":entry.interactionId&&handleVitals("INP",`${entry.duration}`,"performance_input_web_vitals");break;default:break}})});performanceObserver.observe({type:"layout-shift",buffered:!0}),performanceObserver.observe({type:"first-input",buffered:!0}),performanceObserver.observe({type:"largest-contentful-paint",buffered:!0}),performanceObserver.observe({type:"paint",buffered:!0}),performanceObserver.observe({type:"navigation",buffered:!0}),performanceObserver.observe({type:"event",buffered:!0,durationThreshold:0}),getNetworkInformation(),window.addEventListener("load",()=>{setTimeout(()=>{const tti=calculateTTI();if(vitals.TTI=tti,!domLoadedTimeSet||domLoadedTimeValue===0){const apiDomLoadedTime=getDOMLoadedTime();if(apiDomLoadedTime>0)domLoadedTimeValue=apiDomLoadedTime,domLoadedTimeSet=!0,vitals.DOMLoadedTime=apiDomLoadedTime;else if(domContentLoadedTime>0)domLoadedTimeValue=domContentLoadedTime,domLoadedTimeSet=!0,vitals.DOMLoadedTime=domContentLoadedTime;else{const ttfb=parseFloat(vitals.TTFB)||0,lcp=parseFloat(vitals.LCP)||0;ttfb>0&&lcp>0&&(domLoadedTimeValue=Math.round((ttfb+lcp)/2),domLoadedTimeSet=!0,vitals.DOMLoadedTime=domLoadedTimeValue)}}const urlInfo=getUrlInfo();window.dataLayer.push({event:"web_vitals",LCP:vitals.LCP||0,TTFB:vitals.TTFB||0,CLS:vitals.CLS||0,TTI:vitals.TTI||0,DOMLoadedTime:domLoadedTimeValue||0,full_url:urlInfo.full_url,url_without_query:urlInfo.url_without_query})},1e3)})};executeVitalsListeners();
2//# sourceMappingURL=/cdn/shop/t/1044/assets/web-vitals.js.map?v=41073462801500332541789137806

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.