!function(){"use strict";(t=>{const{screen:{width:e,height:a},navigator:{language:n,doNotTrack:r,msDoNotTrack:i},location:o,document:c,history:s,top:d,doNotTrack:u}=t,{currentScript:f,referrer:l}=c;if(!f)return;const{hostname:m,href:h,origin:p}=o;let g;try{g=h.startsWith("data:")?void 0:t.localStorage}catch{}const y="data-",v="true",b=f.getAttribute.bind(f),T=t=>b(`${y}${t}`),w=T("website-id");if(t.__umami_tracker_loaded||(t.__umami_tracker_loaded=new Set),t.__umami_tracker_loaded.has(w))return;t.__umami_tracker_loaded.add(w);const _=T("host-url"),S=T("before-send"),k=T("tag")||void 0,x="false"!==T("auto-track"),E=T("do-not-track")===v,M=T("exclude-search")===v,N=T("exclude-hash")===v,O=T("domains")||"",$=T("fetch-credentials")||"omit",j=T("performance")===v,A=O.split(",").map(t=>t.trim()),L=`${(_||"https://api-gateway.umami.dev").replace(/\/$/,"")}/api/send`,I=`${e}x${a}`,P=/data-umami-event-([\w-_]+)/,K=`${y}umami-event`,R=300,U=t=>{if(!t)return t;try{const e=new URL(t,o.href);return M&&(e.search=""),N&&(e.hash=""),e.toString()}catch{return t}},B=()=>({website:w,screen:I,language:n,title:c.title,hostname:m,url:V,referrer:X,tag:k,id:H||void 0}),D=(t,e,a)=>{a&&("function"==typeof Q&&Q(),X=V,V=U(new URL(a,o.href).toString()),V!==X&&setTimeout(q,R))},W=()=>Z||!w||g?.getItem("umami.disabled")||O&&!A.includes(m)||E&&(()=>{const t=u||r||i;return 1===t||"1"===t||"yes"===t})(),C=async(e,a="event")=>{if(W())return;const n=t[S];if("function"==typeof n&&(e=await Promise.resolve(n(a,e))),e)try{const t=await fetch(L,{keepalive:!0,method:"POST",body:JSON.stringify({type:a,payload:e}),headers:{"Content-Type":"application/json",...void 0!==G&&{"x-umami-cache":G}},credentials:$,priority:"low"}),n=await t.json();n&&(Z=!!n.disabled,G=n.cache)}catch(t){}},J=()=>{Y||(Y=!0,q(),(()=>{const t=(t,e,a)=>{const n=t[e];return(...e)=>(a.apply(null,e),n.apply(t,e))};s.pushState=t(s,"pushState",D),s.replaceState=t(s,"replaceState",D)})(),(()=>{const t=async t=>{const e=t.getAttribute(K);if(e){const a={};return t.getAttributeNames().forEach(e=>{const n=e.match(P);n&&(a[n[1]]=t.getAttribute(e))}),q(e,a)}};c.addEventListener("click",async e=>{const a=e.target,n=a.closest("a,button");if(!n)return t(a);const{href:r,target:i}=n;if(n.getAttribute(K)){if("BUTTON"===n.tagName)return t(n);if("A"===n.tagName&&r){const a="_blank"===i||e.ctrlKey||e.shiftKey||e.metaKey||e.button&&1===e.button;return a||e.preventDefault(),t(n).then(()=>{a||(("_top"===i?d.location:o).href=r)})}}},!0)})(),j&&F())},q=(t,e)=>C("string"==typeof t?{...B(),name:t,data:e}:"object"==typeof t?{...t}:"function"==typeof t?t(B()):B()),z=(t,e)=>("string"==typeof t&&(H=t),G="",C({...B(),data:"object"==typeof t?t:e},"identify")),F=()=>{const e={};let a,n=!1,r=!0,i=0,o=0;const s=(t,e)=>{try{new PerformanceObserver(t=>{t.getEntries().forEach(e)}).observe({type:t,buffered:!0})}catch{}};s("navigation",t=>{i=t.activationStart||0,e.ttfb=Math.max(t.responseStart-i,0)}),s("paint",t=>{"first-contentful-paint"===t.name&&(e.fcp=Math.max(t.startTime-i,0))}),s("largest-contentful-paint",t=>{e.lcp=Math.max(t.startTime-i,0)});let d=0,u=[];s("layout-shift",t=>{if(!t.hadRecentInput){const a=u[u.length-1],n=u[0];a&&t.startTime-a.startTime-a.duration<1e3&&t.startTime-n.startTime<5e3?(d+=t.value,u.push(t)):(d=t.value,u=[t]),d>(e.cls||0)&&(e.cls=d)}});let f={};try{new PerformanceObserver(t=>{t.getEntries().forEach(t=>{if(t.interactionId){const a=f[t.interactionId];(!a||t.duration>a)&&(f[t.interactionId]=t.duration);const n=Object.values(f).sort((t,e)=>e-t);if(n.length){const t=Math.floor(.02*Math.max(n.length,10));e.inp=n[Math.min(t,n.length-1)]}}})}).observe({type:"event",buffered:!0,durationThreshold:40})}catch{}const l=e=>{try{return t.performance?.getEntriesByType?.(e)||[]}catch{return[]}},m=()=>{n||((()=>{if(r){if(void 0===e.ttfb){const t=l("navigation")?.[0];t&&(e.ttfb=Math.max(t.responseStart-(t.activationStart||0),0))}if(void 0===e.fcp){const t=l("paint")?.find(t=>"first-contentful-paint"===t.name);t&&(e.fcp=Math.max(t.startTime-i,0))}if(void 0===e.lcp){const t=l("largest-contentful-paint"),a=t?.[t.length-1];a&&(e.lcp=Math.max(a.startTime-i,0))}}})(),e.duration=Math.round(performance.now()-o),n=!0,a&&clearTimeout(a),C({...B(),...e},"performance"))};Q=()=>{m(),r=!1,Object.keys(e).forEach(t=>{delete e[t]}),i=0,o=performance.now(),d=0,u=[],f={},n=!1,a&&clearTimeout(a),a=setTimeout(m,1e4)},a=setTimeout(m,1e4),c.addEventListener("visibilitychange",()=>{"hidden"===c.visibilityState&&m()}),t.addEventListener("pagehide",m)};t.umami||(t.umami={track:q,identify:z,getSession:()=>({cache:G,website:w})});let G,H,Q,V=U(h),X=U(l.startsWith(p)?"":l),Y=!1,Z=!1;x&&!W()&&("complete"===c.readyState?J():c.addEventListener("readystatechange",J,!0))})(window)}();