"use strict";var Catchmetrics;(function(n){function o(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const t=Math.random()*16|0,i=n==="x"?t:t&3|8;return i.toString(16)})}function c(){return typeof PerformanceLongAnimationFrameTiming!="undefined"}function l(){return{userAgent:navigator.userAgent,screenResolution:`${window.screen.width}x${window.screen.height}`,pageViewId:o()}}function a(n){r=n}function v(){try{if(window.performance&&window.PerformanceObserver){const n=new PerformanceObserver(n=>{n.getEntries().forEach(n=>{i.push(n)})});n.observe({type:"long-animation-frame",buffered:!0})}else console.error("Performance API is not supported.")}catch(n){e(n,r)}}function t(n){console.log(n);try{y()}catch(t){e(t,r)}}function y(){if(i.length!==0){const n={userId:h,tagKey:r,pageViewId:f.pageViewId,collectionNumber:++s,loafDatas:i,pageUrl:window.location.href,navigationStarted:new Date(performance.timing.navigationStart).toISOString(),userAgent:f.userAgent,screenResolution:f.screenResolution};u.debugMode?console.log("Collected rum data dtos:",n):fetch(u.collectUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(()=>console.log("Events collected:")).catch(n=>console.error("Error sending events:",n));i=[]}}function p(){t("collectLoAF called immediately");setTimeout(()=>t("collectLoAF called after 5 seconds delay"),5e3);setTimeout(()=>t("collectLoAF called after 10 seconds delay"),1e4);const n=setInterval(()=>t("collectLoAF called every 30 seconds"),3e4);setTimeout(()=>{clearInterval(n),console.log("Stopped collecting every 30 seconds after 2 minutes."),setInterval(()=>t("collectLoAF called every 1 minute"),6e4)},12e4)}function w(){try{throw new Error;}catch(n){if(n instanceof Error&&n.stack)return n.stack}return""}function e(n,t){let i="";typeof n=="string"?i=n:n instanceof Error&&(i=n.message);try{const n=w(),r={tagKey:t,stackTrace:n,errorMessage:i,userAgent:navigator.userAgent,pageUrl:window.location.href};fetch(u.errorUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then(()=>console.log("Error info sent:")).catch(n=>console.error("Error sending error info:",n))}catch(n){console.error("Error sending error info:",n)}}function b(n){try{!!n&&c()&&(a(n),v(),p())}catch(t){e(t,n)}}const u={collectUrl:"https://rum.catchmetrics.io/tag/collect",errorUrl:"https://rum.catchmetrics.io/tag/logerror",defaultTimeout:3e4,debugMode:!1};let i=[],s=0,r;const f=l(),h=localStorage.getItem("userId")||o();n.init=b})(Catchmetrics||(Catchmetrics={}));window.loafData=window.loafData||{};window.loafData.init=Catchmetrics.init