"use strict";(self.webpackJsonpRuntime=self.webpackJsonpRuntime||[]).push([[241],{8241:(e,t,n)=>{n.r(t),n.d(t,{sendPerformanceMetrics:()=>B});var i=n(8468),r=n(9934),o=n.n(r),a=n(2206),s=n.n(a),l=n(7226),c=n(6856),u=n(9978),d=n.n(u);const p=1e-6,g=1e-6,w=20,h=e=>d()(e)?"unknown":e;function m({device:e=null,connectionType:t=null,connectionSpeed:n=null,viewportWidth:i=null,viewportHeight:r=null,hasCriticalCss:o=null,hasCustomWidgets:a=null,browserName:s=null,browserVersion:l=null,os:c=null,firstVisit:u=null,pageUuid:d=null,serviceWorkerRunning:w=null,siteAlias:m=null,host:v=null,path:f=null,vital:{name:y=null,delta:C=null,value:b=null}}){return{device:e,connectionType:h(t),connectionSpeed:h(n),viewportWidth:i,viewportHeight:r,hasCriticalCss:o,hasCustomWidgets:a,browserName:s,browserVersion:l,os:c,firstVisit:u,pageUuid:d,serviceWorkerRunning:w,siteAlias:m,host:h(v),path:f,[y?.toLowerCase()]:C||g,[`${y?.toLowerCase()}_value`]:b||p,[`${y?.toLowerCase()}_delta`]:C||g}}function v(e){try{let t;if(e.startsWith("#")&&!isNaN(e[1])){const n=e.slice(1);t=document.getElementById(n)}else t=document.querySelector(e);let n=0;for(;t&&n_(e,window),I=e=>!!document.querySelector(e),k=function({apiUrl:e=(0,P.D)("runtimecollector.url")}={}){return async t=>{if(!e)throw new Error("Missing endpoint for runtimecollector");return await fetch(`${e}/performance/metrics`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(t),keepalive:!0}).catch((e=>{T.C_.warn({message:"Error while trying to report Vitals to BI",_skipJournal:!0,error:S()(e)?e.toString():JSON.stringify(e),siteAlias:N()("siteAlias",t),pageUrl:N()("_currentPage.pageUrl",window)})}))}}(),L=C()((e=>T.C_.info(e)),15),U=(...e)=>t=>e.reduce(((e,t)=>e.then(((...e)=>Promise.resolve().then(t.bind(null,...e))))),Promise.resolve(t)),V=({name:e,rating:t})=>{const n="INP"===e&&"poor"===t,i="CLS"===e&&"poor"===t,r=!!(0,c.V)("runtime.cwv.report.cls.enabled",!1);return n||r&&i},E=function(e){return async function(){const e=(window?.sessionStorage??window)._cohortId=Math.random()<.5?0:1,t=W("_currentDevice"),n=W("navigator.connection.type"),r=W("navigator.connection.effectiveType"),o=W("Parameters.SiteAlias"),a=W("window.location.host"),s=W("location.pathname"),l=I("#criticalCss"),c=I('[data-element-type="custom_extension"]'),u=W("innerWidth"),d=W("innerHeight"),p=["_currentPage.pageContent.uuid","Parameters.InitialPageUuid"].map((e=>_(e,window))).filter(Boolean).at(0),{name:g=null,version:w=null,os:h=null}=(0,i.o0)();return{device:t,connectionType:n,connectionSpeed:r,viewportWidth:u,viewportHeight:d,hasCriticalCss:l,hasCustomWidgets:c,browserName:g,browserVersion:w,os:h,pageUuid:p,siteAlias:o,host:a,path:s,cohortId:e}}().then(o()({vital:e}))};async function B({sendLog:e=!0}={}){const t=[U(E,m,k),async t=>{if(e&&V(t))return U(E,f,L)(t)}].filter(Boolean);[l.IN,l.Ck,e=>(0,l.rH)(e,{durationThreshold:0,reportAllChanges:!0}),l.fK,l.zB].forEach((e=>e((e=>{Promise.all(t.map((t=>t(e).catch(console.warn))))}))))}}}]);