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