@junobuild/analytics 0.1.8 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/chunk-YVLJX3HV.js +2 -0
- package/dist/browser/chunk-YVLJX3HV.js.map +7 -0
- package/dist/browser/chunk-ZUUQVOC7.js +2 -0
- package/dist/browser/chunk-ZUUQVOC7.js.map +7 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/tracker.js +2 -0
- package/dist/browser/tracker.js.map +7 -0
- package/dist/browser/ua-parser-GFKOYVJI.js +2 -0
- package/dist/browser/ua-parser-GFKOYVJI.js.map +7 -0
- package/dist/browser/web-vitals-YBMS6D2C.js +2 -0
- package/dist/browser/web-vitals-YBMS6D2C.js.map +7 -0
- package/dist/node/index.mjs +1 -1
- package/dist/node/index.mjs.map +4 -4
- package/dist/types/api/orbiter.api.d.ts +26 -0
- package/dist/types/constants/container.constants.d.ts +1 -0
- package/dist/types/index.d.ts +8 -3
- package/dist/types/services/orbiter.services.d.ts +10 -0
- package/dist/types/services/performance.services.d.ts +11 -1
- package/dist/types/services/user-agent.services.d.ts +4 -0
- package/dist/types/tracker.d.ts +37 -0
- package/dist/types/types/env.d.ts +10 -25
- package/dist/types/types/orbiter.d.ts +95 -0
- package/dist/types/types/track.d.ts +2 -4
- package/dist/types/utils/analytics.utils.d.ts +2 -3
- package/dist/types/utils/dfinity/asserts.utils.d.ts +7 -0
- package/dist/types/utils/dfinity/debounce.utils.d.ts +12 -0
- package/dist/types/utils/dfinity/json.utils.d.ts +25 -0
- package/dist/types/utils/dfinity/nullish.utils.d.ts +30 -0
- package/dist/types/utils/env.utils.d.ts +5 -0
- package/dist/types/utils/log.utils.d.ts +1 -1
- package/package.json +5 -10
- package/dist/browser/idb.services-CVJFLYYN.js +0 -2
- package/dist/browser/idb.services-CVJFLYYN.js.map +0 -7
- package/dist/browser/web-vitals-JGDN2KW5.js +0 -2
- package/dist/browser/web-vitals-JGDN2KW5.js.map +0 -7
- package/dist/declarations/orbiter/orbiter.did.d.ts +0 -229
- package/dist/declarations/orbiter/orbiter.factory.certified.did.js +0 -255
- package/dist/declarations/orbiter/orbiter.factory.did.js +0 -271
- package/dist/declarations/orbiter/orbiter.factory.did.mjs +0 -271
- package/dist/types/api/actor.api.d.ts +0 -3
- package/dist/types/services/analytics.services.d.ts +0 -25
- package/dist/types/services/idb.services.d.ts +0 -19
- package/dist/types/types/idb.d.ts +0 -12
- package/dist/types/types/post-message.d.ts +0 -7
- package/dist/types/utils/actor.utils.d.ts +0 -6
- package/dist/types/workers/analytics.worker.d.ts +0 -1
- package/dist/workers/analytics.worker.js +0 -89
- package/dist/workers/analytics.worker.js.map +0 -7
package/dist/node/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as topLevelCreateRequire } from 'module';
|
|
2
2
|
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
-
var je=Object.defineProperty;var j=(e,t)=>()=>(e&&(t=e(e=0)),t);var pe=(e,t)=>{for(var n in t)je(e,n,{get:t[n],enumerable:!0})};var Ce={};pe(Ce,{CLSThresholds:()=>Z,FCPThresholds:()=>X,FIDThresholds:()=>Y,INPThresholds:()=>q,LCPThresholds:()=>J,TTFBThresholds:()=>Q,onCLS:()=>Je,onFCP:()=>Te,onFID:()=>ct,onINP:()=>nt,onLCP:()=>rt,onTTFB:()=>ot});var G,m,S,we,A,Ie,g,$,B,l,T,p,ee,C,V,I,ge,D,ye,qe,te,L,X,Te,Z,Je,Pe,H,N,Qe,Ee,Ye,f,_,ke,$e,et,tt,be,q,nt,J,z,rt,Q,it,ot,M,at,he,Me,st,Se,Y,ct,Le=j(()=>{Ie=-1,g=function(e){addEventListener("pageshow",function(t){t.persisted&&(Ie=t.timeStamp,e(t))},!0)},$=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},B=function(){var e=$();return e&&e.activationStart||0},l=function(e,t){var n=$(),i="navigate";return Ie>=0?i="back-forward-cache":n&&(document.prerendering||B()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},T=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver(function(r){Promise.resolve().then(function(){t(r.getEntries())})});return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch{}},p=function(e,t,n,i){var r,o;return function(a){t.value>=0&&(a||i)&&((o=t.value-(r||0))||r===void 0)&&(r=t.value,t.delta=o,t.rating=function(c,s){return c>s[1]?"poor":c>s[0]?"needs-improvement":"good"}(t.value,n),e(t))}},ee=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},C=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},V=function(e){var t=!1;return function(){t||(e(),t=!0)}},I=-1,ge=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},D=function(e){document.visibilityState==="hidden"&&I>-1&&(I=e.type==="visibilitychange"?e.timeStamp:0,qe())},ye=function(){addEventListener("visibilitychange",D,!0),addEventListener("prerenderingchange",D,!0)},qe=function(){removeEventListener("visibilitychange",D,!0),removeEventListener("prerenderingchange",D,!0)},te=function(){return I<0&&(I=ge(),ye(),g(function(){setTimeout(function(){I=ge(),ye()},0)})),{get firstHiddenTime(){return I}}},L=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},X=[1800,3e3],Te=function(e,t){t=t||{},L(function(){var n,i=te(),r=l("FCP"),o=T("paint",function(a){a.forEach(function(c){c.name==="first-contentful-paint"&&(o.disconnect(),c.startTime<i.firstHiddenTime&&(r.value=Math.max(c.startTime-B(),0),r.entries.push(c),n(!0)))})});o&&(n=p(e,r,X,t.reportAllChanges),g(function(a){r=l("FCP"),n=p(e,r,X,t.reportAllChanges),ee(function(){r.value=performance.now()-a.timeStamp,n(!0)})}))})},Z=[.1,.25],Je=function(e,t){t=t||{},Te(V(function(){var n,i=l("CLS",0),r=0,o=[],a=function(s){s.forEach(function(u){if(!u.hadRecentInput){var W=o[0],le=o[o.length-1];r&&u.startTime-le.startTime<1e3&&u.startTime-W.startTime<5e3?(r+=u.value,o.push(u)):(r=u.value,o=[u])}}),r>i.value&&(i.value=r,i.entries=o,n())},c=T("layout-shift",a);c&&(n=p(e,i,Z,t.reportAllChanges),C(function(){a(c.takeRecords()),n(!0)}),g(function(){r=0,i=l("CLS",0),n=p(e,i,Z,t.reportAllChanges),ee(function(){return n()})}),setTimeout(n,0))}))},Pe=0,H=1/0,N=0,Qe=function(e){e.forEach(function(t){t.interactionId&&(H=Math.min(H,t.interactionId),N=Math.max(N,t.interactionId),Pe=N?(N-H)/7+1:0)})},Ee=function(){return G?Pe:performance.interactionCount||0},Ye=function(){"interactionCount"in performance||G||(G=T("event",Qe,{type:"event",buffered:!0,durationThreshold:0}))},f=[],_=new Map,ke=0,$e=function(){var e=Math.min(f.length-1,Math.floor((Ee()-ke)/50));return f[e]},et=[],tt=function(e){if(et.forEach(function(r){return r(e)}),e.interactionId||e.entryType==="first-input"){var t=f[f.length-1],n=_.get(e.interactionId);if(n||f.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};_.set(i.id,i),f.push(i)}f.sort(function(r,o){return o.latency-r.latency}),f.length>10&&f.splice(10).forEach(function(r){return _.delete(r.id)})}}},be=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=V(e),document.visibilityState==="hidden"?e():(n=t(e),C(e)),n},q=[200,500],nt=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},L(function(){var n;Ye();var i,r=l("INP"),o=function(c){be(function(){c.forEach(tt);var s=$e();s&&s.latency!==r.value&&(r.value=s.latency,r.entries=s.entries,i())})},a=T("event",o,{durationThreshold:(n=t.durationThreshold)!==null&&n!==void 0?n:40});i=p(e,r,q,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),C(function(){o(a.takeRecords()),i(!0)}),g(function(){ke=Ee(),f.length=0,_.clear(),r=l("INP"),i=p(e,r,q,t.reportAllChanges)}))}))},J=[2500,4e3],z={},rt=function(e,t){t=t||{},L(function(){var n,i=te(),r=l("LCP"),o=function(s){t.reportAllChanges||(s=s.slice(-1)),s.forEach(function(u){u.startTime<i.firstHiddenTime&&(r.value=Math.max(u.startTime-B(),0),r.entries=[u],n())})},a=T("largest-contentful-paint",o);if(a){n=p(e,r,J,t.reportAllChanges);var c=V(function(){z[r.id]||(o(a.takeRecords()),a.disconnect(),z[r.id]=!0,n(!0))});["keydown","click"].forEach(function(s){addEventListener(s,function(){return be(c)},{once:!0,capture:!0})}),C(c),g(function(s){r=l("LCP"),n=p(e,r,J,t.reportAllChanges),ee(function(){r.value=performance.now()-s.timeStamp,z[r.id]=!0,n(!0)})})}})},Q=[800,1800],it=function e(t){document.prerendering?L(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},ot=function(e,t){t=t||{};var n=l("TTFB"),i=p(e,n,Q,t.reportAllChanges);it(function(){var r=$();r&&(n.value=Math.max(r.responseStart-B(),0),n.entries=[r],i(!0),g(function(){n=l("TTFB",0),(i=p(e,n,Q,t.reportAllChanges))(!0)}))})},M={passive:!0,capture:!0},at=new Date,he=function(e,t){m||(m=t,S=e,we=new Date,Se(removeEventListener),Me())},Me=function(){if(S>=0&&S<we-at){var e={entryType:"first-input",name:m.type,target:m.target,cancelable:m.cancelable,startTime:m.timeStamp,processingStart:m.timeStamp+S};A.forEach(function(t){t(e)}),A=[]}},st=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;e.type=="pointerdown"?function(n,i){var r=function(){he(n,i),a()},o=function(){a()},a=function(){removeEventListener("pointerup",r,M),removeEventListener("pointercancel",o,M)};addEventListener("pointerup",r,M),addEventListener("pointercancel",o,M)}(t,e):he(t,e)}},Se=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,st,M)})},Y=[100,300],ct=function(e,t){t=t||{},L(function(){var n,i=te(),r=l("FID"),o=function(s){s.startTime<i.firstHiddenTime&&(r.value=s.processingStart-s.startTime,r.entries.push(s),n(!0))},a=function(s){s.forEach(o)},c=T("first-input",a);n=p(e,r,Y,t.reportAllChanges),c&&(C(V(function(){a(c.takeRecords()),c.disconnect()})),g(function(){var s;r=l("FID"),n=p(e,r,Y,t.reportAllChanges),A=[],S=-1,m=null,Se(addEventListener),s=o,A.push(s),Me()}))})}});function P(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function x(e,t){let n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);let i=P(n);return(r,o)=>i.then(a=>o(a.transaction(t,r).objectStore(t)))}function re(){return ne||(ne=x("keyval-store","keyval")),ne}function F(e,t,n=re()){return n("readwrite",i=>(i.put(t,e),P(i.transaction)))}function R(e,t=re()){return t("readwrite",n=>(e.forEach(i=>n.delete(i)),P(n.transaction)))}function ut(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},P(e.transaction)}function O(e=re()){return e("readonly",t=>{if(t.getAll&&t.getAllKeys)return Promise.all([P(t.getAllKeys()),P(t.getAll())]).then(([i,r])=>i.map((o,a)=>[o,r[a]]));let n=[];return e("readonly",i=>ut(i,r=>n.push([r.key,r.value])).then(()=>n))})}var ne,xe=j(()=>{});var U={};pe(U,{delPageViews:()=>pt,delPerformanceMetrics:()=>ht,delTrackEvents:()=>vt,getPageViews:()=>lt,getPerformanceMetrics:()=>yt,getTrackEvents:()=>mt,setPageView:()=>dt,setPerformanceMetric:()=>gt,setTrackEvent:()=>ft});var ie,oe,ae,dt,lt,pt,ft,mt,vt,gt,yt,ht,K=j(()=>{"use strict";xe();ie=x("juno-views","views"),oe=x("juno-events","events"),ae=x("juno-metrics","metrics"),dt=({key:e,view:t})=>F(e,t,ie),lt=()=>O(ie),pt=e=>R(e,ie),ft=({key:e,track:t})=>F(e,t,oe),mt=()=>O(oe),vt=e=>R(e,oe),gt=({key:e,view:t})=>F(e,t,ae),yt=()=>O(ae),ht=e=>R(e,ae)});import{assertNonNullish as Ke}from"@dfinity/utils";import{assertNonNullish as se,nonNullish as Pt,toNullable as Et}from"@dfinity/utils";import{isBrowser as ce}from"@junobuild/utils";import{webcrypto as me}from"node:crypto";var fe="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var He=128,v,y;function ze(e){!v||v.length<e?(v=Buffer.allocUnsafe(e*He),me.getRandomValues(v),y=0):y+e>v.length&&(me.getRandomValues(v),y=0),y+=e}function h(e=21){ze(e|=0);let t="";for(let n=y-e;n<y;n++)t+=fe[v[n]&63];return t}import{toNullable as Ge}from"@dfinity/utils";var ve=()=>BigInt(Date.now())*BigInt(1e6);var k=()=>({collected_at:ve(),updated_at:[],version:[]}),b=()=>{let{userAgent:e}=navigator;return{user_agent:Ge(e)}};import{isNullish as Xe}from"@dfinity/utils";var Ze="Analytics worker not initialized. Did you call `initOrbiter`?",w=e=>{Xe(e)&&console.warn(Ze)};import{toNullable as wt}from"@dfinity/utils";var Ne=async e=>{let{onCLS:t,onFCP:n,onINP:i,onLCP:r,onTTFB:o}=await Promise.resolve().then(()=>(Le(),Ce)),a=c=>{(async()=>await It({...c,sessionId:e}))()};t(a),n(a),i(a),r(a),o(a)},It=async e=>{let t=Tt(e);if(t==="unknown"){console.warn("Performance metric ignored. Unknown metric name.",e);return}if(t==="deprecated")return;await(await Promise.resolve().then(()=>(K(),U))).setPerformanceMetric({key:h(),view:t})},Tt=({sessionId:e,name:t,value:n,delta:i,id:r,navigationType:o})=>{let c=(()=>{switch(t){case"CLS":return{CLS:null};case"FCP":return{FCP:null};case"INP":return{INP:null};case"LCP":return{LCP:null};case"TTFB":return{TTFB:null};case"FID":return"deprecated";default:return"unknown"}})();if(c==="unknown"||c==="deprecated")return c;let u={value:n,delta:i,id:r,navigation_type:wt((()=>{switch(o){case"navigate":return{Navigate:null};case"restore":return{Restore:null};case"reload":return{Reload:null};case"back-forward":return{BackForward:null};case"back-forward-cache":return{BackForwardCache:null};case"prerender":return{Prerender:null};default:return}})())},{location:{href:W}}=document,{updated_at:le,...We}=k();return{href:W,metric_name:c,session_id:e,data:{WebVitalsMetric:u},...b(),...We}};var kt=()=>{if(!(typeof crypto>"u"))return h()},E=kt(),d,_e=e=>{let{path:t}=e.worker??{},n=t??"./workers/analytics.worker.js";d=new Worker(n);let i=()=>console.warn("Unable to connect to the analytics web worker. Have you deployed it?");return d?.addEventListener("error",i,!1),Mt(e),{cleanup(){d?.removeEventListener("error",i,!1)}}},Ae=()=>{let e=async()=>await Be(),t=new Proxy(history.pushState,{apply:async(n,i,r)=>{n.apply(i,r),await e()}});return history.pushState=t,addEventListener("popstate",e,{passive:!0}),{cleanup(){t=null,removeEventListener("popstate",e,!1)}}},ue="No session ID initialized.",de=async()=>{if(!ce())return;se(E,ue);let{title:e,location:{href:t},referrer:n}=document,{innerWidth:i,innerHeight:r}=window,{timeZone:o}=Intl.DateTimeFormat().resolvedOptions(),a={title:e,href:t,referrer:Et(Pt(n)&&n!==""?n:void 0),device:{inner_width:i,inner_height:r},time_zone:o,session_id:E,...b(),...k()};await(await Promise.resolve().then(()=>(K(),U))).setPageView({key:h(),view:a})},De=async({options:e})=>{ce()&&e?.performance!==!1&&(se(E,ue),await Ne(E))},Be=async()=>{w(d),await de(),d?.postMessage({msg:"junoTrackPageView"})},bt=async e=>{if(!ce())return;se(E,ue),w(d),await(await Promise.resolve().then(()=>(K(),U))).setTrackEvent({key:h(),track:{...e,session_id:E,...b(),...k()}}),d?.postMessage({msg:"junoTrackEvent"})},Mt=e=>{w(d),d?.postMessage({msg:"junoInitEnvironment",data:e})},Ve=()=>{w(d),d?.postMessage({msg:"junoStartTrackTimer"})},Fe=()=>{w(d),d?.postMessage({msg:"junoStopTracker"})};var Re=()=>{let e=()=>typeof import.meta<"u"&&typeof import.meta.env<"u"?import.meta.env?.VITE_SATELLITE_ID??import.meta.env?.PUBLIC_SATELLITE_ID:void 0;return typeof process<"u"?process.env?.NEXT_PUBLIC_SATELLITE_ID??e():e()},Oe=()=>{let e=()=>typeof import.meta<"u"&&typeof import.meta.env<"u"?import.meta.env?.VITE_ORBITER_ID??import.meta.env?.PUBLIC_ORBITER_ID:void 0;return typeof process<"u"?process.env?.NEXT_PUBLIC_ORBITER_ID??e():e()},Ue=()=>{let e=()=>typeof import.meta<"u"&&typeof import.meta.env<"u"?import.meta.env?.VITE_CONTAINER??import.meta.env?.PUBLIC_CONTAINER:void 0;return typeof process<"u"?process.env?.NEXT_PUBLIC_CONTAINER??e():e()};var St=e=>{let t=e?.satelliteId??Re();Ke(t,"Satellite ID is not configured. Orbiter cannot be initialized without a target Satellite.");let n=e?.orbiterId??Oe();Ke(n,"Orbiter ID is not configured. The analytics cannot be initialized without an Orbiter.");let i=e?.container??Ue();return{orbiterId:n,satelliteId:t,container:i,worker:e?.worker,options:e?.options}},rn=async e=>{await de();let t=St(e),{cleanup:n}=_e(t),{cleanup:i}=Ae();return await De(t),Ve(),()=>{Fe(),n(),i()}};export{rn as initOrbiter,bt as trackEvent,Be as trackPageView};
|
|
3
|
+
var jt=Object.create;var Le=Object.defineProperty;var Ht=Object.getOwnPropertyDescriptor;var Gt=Object.getOwnPropertyNames;var Wt=Object.getPrototypeOf,$t=Object.prototype.hasOwnProperty;var Xt=(e,t)=>()=>(e&&(t=e(e=0)),t);var Yt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Zt=(e,t)=>{for(var o in t)Le(e,o,{get:t[o],enumerable:!0})},Kt=(e,t,o,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Gt(t))!$t.call(e,s)&&s!==o&&Le(e,s,{get:()=>t[s],enumerable:!(u=Ht(t,s))||u.enumerable});return e};var Jt=(e,t,o)=>(o=e!=null?jt(Wt(e)):{},Kt(t||!e||!e.__esModule?Le(o,"default",{value:e,enumerable:!0}):o,e));var Mt={};Zt(Mt,{CLSThresholds:()=>Fe,FCPThresholds:()=>De,FIDThresholds:()=>Ge,INPThresholds:()=>ze,LCPThresholds:()=>je,TTFBThresholds:()=>He,onCLS:()=>ni,onFCP:()=>kt,onFID:()=>wi,onINP:()=>ui,onLCP:()=>li,onTTFB:()=>pi});var Ve,q,ie,yt,ge,Tt,U,We,Te,x,W,I,$e,ne,ke,G,vt,ye,ht,ii,Xe,re,De,kt,Fe,ni,Et,Be,ve,ri,Pt,oi,A,he,St,ai,si,ci,xt,ze,ui,je,Ue,li,He,di,pi,te,mi,gt,It,fi,_t,Ge,wi,Nt=Xt(()=>{Tt=-1,U=function(e){addEventListener("pageshow",function(t){t.persisted&&(Tt=t.timeStamp,e(t))},!0)},We=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Te=function(){var e=We();return e&&e.activationStart||0},x=function(e,t){var o=We(),u="navigate";return Tt>=0?u="back-forward-cache":o&&(document.prerendering||Te()>0?u="prerender":document.wasDiscarded?u="restore":o.type&&(u=o.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:u}},W=function(e,t,o){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var u=new PerformanceObserver(function(s){Promise.resolve().then(function(){t(s.getEntries())})});return u.observe(Object.assign({type:e,buffered:!0},o||{})),u}}catch{}},I=function(e,t,o,u){var s,p;return function(w){t.value>=0&&(w||u)&&((p=t.value-(s||0))||s===void 0)&&(s=t.value,t.delta=p,t.rating=function(y,l){return y>l[1]?"poor":y>l[0]?"needs-improvement":"good"}(t.value,o),e(t))}},$e=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},ne=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},ke=function(e){var t=!1;return function(){t||(e(),t=!0)}},G=-1,vt=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},ye=function(e){document.visibilityState==="hidden"&&G>-1&&(G=e.type==="visibilitychange"?e.timeStamp:0,ii())},ht=function(){addEventListener("visibilitychange",ye,!0),addEventListener("prerenderingchange",ye,!0)},ii=function(){removeEventListener("visibilitychange",ye,!0),removeEventListener("prerenderingchange",ye,!0)},Xe=function(){return G<0&&(G=vt(),ht(),U(function(){setTimeout(function(){G=vt(),ht()},0)})),{get firstHiddenTime(){return G}}},re=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},De=[1800,3e3],kt=function(e,t){t=t||{},re(function(){var o,u=Xe(),s=x("FCP"),p=W("paint",function(w){w.forEach(function(y){y.name==="first-contentful-paint"&&(p.disconnect(),y.startTime<u.firstHiddenTime&&(s.value=Math.max(y.startTime-Te(),0),s.entries.push(y),o(!0)))})});p&&(o=I(e,s,De,t.reportAllChanges),U(function(w){s=x("FCP"),o=I(e,s,De,t.reportAllChanges),$e(function(){s.value=performance.now()-w.timeStamp,o(!0)})}))})},Fe=[.1,.25],ni=function(e,t){t=t||{},kt(ke(function(){var o,u=x("CLS",0),s=0,p=[],w=function(l){l.forEach(function(k){if(!k.hadRecentInput){var n=p[0],a=p[p.length-1];s&&k.startTime-a.startTime<1e3&&k.startTime-n.startTime<5e3?(s+=k.value,p.push(k)):(s=k.value,p=[k])}}),s>u.value&&(u.value=s,u.entries=p,o())},y=W("layout-shift",w);y&&(o=I(e,u,Fe,t.reportAllChanges),ne(function(){w(y.takeRecords()),o(!0)}),U(function(){s=0,u=x("CLS",0),o=I(e,u,Fe,t.reportAllChanges),$e(function(){return o()})}),setTimeout(o,0))}))},Et=0,Be=1/0,ve=0,ri=function(e){e.forEach(function(t){t.interactionId&&(Be=Math.min(Be,t.interactionId),ve=Math.max(ve,t.interactionId),Et=ve?(ve-Be)/7+1:0)})},Pt=function(){return Ve?Et:performance.interactionCount||0},oi=function(){"interactionCount"in performance||Ve||(Ve=W("event",ri,{type:"event",buffered:!0,durationThreshold:0}))},A=[],he=new Map,St=0,ai=function(){var e=Math.min(A.length-1,Math.floor((Pt()-St)/50));return A[e]},si=[],ci=function(e){if(si.forEach(function(s){return s(e)}),e.interactionId||e.entryType==="first-input"){var t=A[A.length-1],o=he.get(e.interactionId);if(o||A.length<10||e.duration>t.latency){if(o)e.duration>o.latency?(o.entries=[e],o.latency=e.duration):e.duration===o.latency&&e.startTime===o.entries[0].startTime&&o.entries.push(e);else{var u={id:e.interactionId,latency:e.duration,entries:[e]};he.set(u.id,u),A.push(u)}A.sort(function(s,p){return p.latency-s.latency}),A.length>10&&A.splice(10).forEach(function(s){return he.delete(s.id)})}}},xt=function(e){var t=self.requestIdleCallback||self.setTimeout,o=-1;return e=ke(e),document.visibilityState==="hidden"?e():(o=t(e),ne(e)),o},ze=[200,500],ui=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},re(function(){var o;oi();var u,s=x("INP"),p=function(y){xt(function(){y.forEach(ci);var l=ai();l&&l.latency!==s.value&&(s.value=l.latency,s.entries=l.entries,u())})},w=W("event",p,{durationThreshold:(o=t.durationThreshold)!==null&&o!==void 0?o:40});u=I(e,s,ze,t.reportAllChanges),w&&(w.observe({type:"first-input",buffered:!0}),ne(function(){p(w.takeRecords()),u(!0)}),U(function(){St=Pt(),A.length=0,he.clear(),s=x("INP"),u=I(e,s,ze,t.reportAllChanges)}))}))},je=[2500,4e3],Ue={},li=function(e,t){t=t||{},re(function(){var o,u=Xe(),s=x("LCP"),p=function(l){t.reportAllChanges||(l=l.slice(-1)),l.forEach(function(k){k.startTime<u.firstHiddenTime&&(s.value=Math.max(k.startTime-Te(),0),s.entries=[k],o())})},w=W("largest-contentful-paint",p);if(w){o=I(e,s,je,t.reportAllChanges);var y=ke(function(){Ue[s.id]||(p(w.takeRecords()),w.disconnect(),Ue[s.id]=!0,o(!0))});["keydown","click"].forEach(function(l){addEventListener(l,function(){return xt(y)},{once:!0,capture:!0})}),ne(y),U(function(l){s=x("LCP"),o=I(e,s,je,t.reportAllChanges),$e(function(){s.value=performance.now()-l.timeStamp,Ue[s.id]=!0,o(!0)})})}})},He=[800,1800],di=function e(t){document.prerendering?re(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},pi=function(e,t){t=t||{};var o=x("TTFB"),u=I(e,o,He,t.reportAllChanges);di(function(){var s=We();s&&(o.value=Math.max(s.responseStart-Te(),0),o.entries=[s],u(!0),U(function(){o=x("TTFB",0),(u=I(e,o,He,t.reportAllChanges))(!0)}))})},te={passive:!0,capture:!0},mi=new Date,gt=function(e,t){q||(q=t,ie=e,yt=new Date,_t(removeEventListener),It())},It=function(){if(ie>=0&&ie<yt-mi){var e={entryType:"first-input",name:q.type,target:q.target,cancelable:q.cancelable,startTime:q.timeStamp,processingStart:q.timeStamp+ie};ge.forEach(function(t){t(e)}),ge=[]}},fi=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;e.type=="pointerdown"?function(o,u){var s=function(){gt(o,u),w()},p=function(){w()},w=function(){removeEventListener("pointerup",s,te),removeEventListener("pointercancel",p,te)};addEventListener("pointerup",s,te),addEventListener("pointercancel",p,te)}(t,e):gt(t,e)}},_t=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,fi,te)})},Ge=[100,300],wi=function(e,t){t=t||{},re(function(){var o,u=Xe(),s=x("FID"),p=function(l){l.startTime<u.firstHiddenTime&&(s.value=l.processingStart-l.startTime,s.entries.push(l),o(!0))},w=function(l){l.forEach(p)},y=W("first-input",w);o=I(e,s,Ge,t.reportAllChanges),y&&(ne(ke(function(){w(y.takeRecords()),y.disconnect()})),U(function(){var l;s=x("FID"),o=I(e,s,Ge,t.reportAllChanges),ge=[],ie=-1,q=null,_t(addEventListener),l=p,ge.push(l),It()}))})}});var Rt=Yt((oe,Pe)=>{(function(e,t){"use strict";var o="1.0.40",u="",s="?",p="function",w="undefined",y="object",l="string",k="major",n="model",a="name",i="type",r="vendor",c="version",_="architecture",X="console",f="mobile",b="tablet",E="smarttv",C="wearable",Ie="embedded",_e=500,se="Amazon",Y="Apple",Qe="ASUS",et="BlackBerry",ce="Browser",ue="Chrome",Vt="Edge",le="Firefox",Z="Google",tt="Huawei",Me="LG",Ne="Microsoft",it="Motorola",K="Opera",J="Samsung",nt="Sharp",de="Sony",Re="Xiaomi",Ae="Zebra",rt="Facebook",ot="Chromium OS",at="Mac OS",st=" Browser",Dt=function(v,h){var m={};for(var T in v)h[T]&&h[T].length%2===0?m[T]=h[T].concat(v[T]):m[T]=v[T];return m},pe=function(v){for(var h={},m=0;m<v.length;m++)h[v[m].toUpperCase()]=v[m];return h},ct=function(v,h){return typeof v===l?D(h).indexOf(D(v))!==-1:!1},D=function(v){return v.toLowerCase()},Ft=function(v){return typeof v===l?v.replace(/[^\d\.]/g,u).split(".")[0]:t},Ce=function(v,h){if(typeof v===l)return v=v.replace(/^\s\s*/,u),typeof h===w?v:v.substring(0,_e)},Q=function(v,h){for(var m=0,T,O,N,g,d,R;m<h.length&&!d;){var Oe=h[m],dt=h[m+1];for(T=O=0;T<Oe.length&&!d&&Oe[T];)if(d=Oe[T++].exec(v),d)for(N=0;N<dt.length;N++)R=d[++O],g=dt[N],typeof g===y&&g.length>0?g.length===2?typeof g[1]==p?this[g[0]]=g[1].call(this,R):this[g[0]]=g[1]:g.length===3?typeof g[1]===p&&!(g[1].exec&&g[1].test)?this[g[0]]=R?g[1].call(this,R,g[2]):t:this[g[0]]=R?R.replace(g[1],g[2]):t:g.length===4&&(this[g[0]]=R?g[3].call(this,R.replace(g[1],g[2])):t):this[g]=R||t;m+=2}},me=function(v,h){for(var m in h)if(typeof h[m]===y&&h[m].length>0){for(var T=0;T<h[m].length;T++)if(ct(h[m][T],v))return m===s?t:m}else if(ct(h[m],v))return m===s?t:m;return h.hasOwnProperty("*")?h["*"]:v},zt={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},ut={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},lt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[c,[a,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[c,[a,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[a,c],[/opios[\/ ]+([\w\.]+)/i],[c,[a,K+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[c,[a,K+" GX"]],[/\bopr\/([\w\.]+)/i],[c,[a,K]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[c,[a,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[c,[a,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[a,c],[/quark(?:pc)?\/([-\w\.]+)/i],[c,[a,"Quark"]],[/\bddg\/([\w\.]+)/i],[c,[a,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[c,[a,"UC"+ce]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[c,[a,"WeChat"]],[/konqueror\/([\w\.]+)/i],[c,[a,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[c,[a,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[c,[a,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[c,[a,"Smart Lenovo "+ce]],[/(avast|avg)\/([\w\.]+)/i],[[a,/(.+)/,"$1 Secure "+ce],c],[/\bfocus\/([\w\.]+)/i],[c,[a,le+" Focus"]],[/\bopt\/([\w\.]+)/i],[c,[a,K+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[c,[a,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[c,[a,"Dolphin"]],[/coast\/([\w\.]+)/i],[c,[a,K+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[c,[a,"MIUI"+st]],[/fxios\/([\w\.-]+)/i],[c,[a,le]],[/\bqihoobrowser\/?([\w\.]*)/i],[c,[a,"360"]],[/\b(qq)\/([\w\.]+)/i],[[a,/(.+)/,"$1Browser"],c],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[a,/(.+)/,"$1"+st],c],[/samsungbrowser\/([\w\.]+)/i],[c,[a,J+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[c,[a,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[a,"Sogou Mobile"],c],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[a,c],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[a],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[c,a],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[a,rt],c],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[a,c],[/\bgsa\/([\w\.]+) .*safari\//i],[c,[a,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[c,[a,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[c,[a,ue+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[a,ue+" WebView"],c],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[c,[a,"Android "+ce]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[a,c],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[c,[a,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[c,a],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[a,[c,me,zt]],[/(webkit|khtml)\/([\w\.]+)/i],[a,c],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[a,"Netscape"],c],[/(wolvic|librewolf)\/([\w\.]+)/i],[a,c],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[c,[a,le+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[a,[c,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[a,[c,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[_,"amd64"]],[/(ia32(?=;))/i],[[_,D]],[/((?:i[346]|x)86)[;\)]/i],[[_,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[_,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[_,"armhf"]],[/windows (ce|mobile); ppc;/i],[[_,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[_,/ower/,u,D]],[/(sun4\w)[;\)]/i],[[_,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[_,D]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[n,[r,J],[i,b]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[n,[r,J],[i,f]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[n,[r,Y],[i,f]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[n,[r,Y],[i,b]],[/(macintosh);/i],[n,[r,Y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[n,[r,nt],[i,f]],[/(?:honor)([-\w ]+)[;\)]/i],[n,[r,"Honor"],[i,f]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[n,[r,tt],[i,b]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[n,[r,tt],[i,f]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[n,/_/g," "],[r,Re],[i,f]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[n,/_/g," "],[r,Re],[i,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[n,[r,"OPPO"],[i,f]],[/\b(opd2\d{3}a?) bui/i],[n,[r,"OPPO"],[i,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[n,[r,"Vivo"],[i,f]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[n,[r,"Realme"],[i,f]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[n,[r,it],[i,f]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[n,[r,it],[i,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[n,[r,Me],[i,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[n,[r,Me],[i,f]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[n,[r,"Lenovo"],[i,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[n,/_/g," "],[r,"Nokia"],[i,f]],[/(pixel c)\b/i],[n,[r,Z],[i,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[n,[r,Z],[i,f]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[n,[r,de],[i,f]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[n,"Xperia Tablet"],[r,de],[i,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[n,[r,"OnePlus"],[i,f]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[n,[r,se],[i,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[n,/(.+)/g,"Fire Phone $1"],[r,se],[i,f]],[/(playbook);[-\w\),; ]+(rim)/i],[n,r,[i,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[n,[r,et],[i,f]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[n,[r,Qe],[i,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[n,[r,Qe],[i,f]],[/(nexus 9)/i],[n,[r,"HTC"],[i,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[r,[n,/_/g," "],[i,f]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[n,[r,"TCL"],[i,b]],[/(itel) ((\w+))/i],[[r,D],n,[i,me,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[n,[r,"Acer"],[i,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[n,[r,"Meizu"],[i,f]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[n,[r,"Ulefone"],[i,f]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[n,[r,"Energizer"],[i,f]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[n,[r,"Cat"],[i,f]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[n,[r,"Smartfren"],[i,f]],[/droid.+; (a(?:015|06[35]|142p?))/i],[n,[r,"Nothing"],[i,f]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[r,n,[i,f]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[r,n,[i,b]],[/(surface duo)/i],[n,[r,Ne],[i,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[n,[r,"Fairphone"],[i,f]],[/(u304aa)/i],[n,[r,"AT&T"],[i,f]],[/\bsie-(\w*)/i],[n,[r,"Siemens"],[i,f]],[/\b(rct\w+) b/i],[n,[r,"RCA"],[i,b]],[/\b(venue[\d ]{2,7}) b/i],[n,[r,"Dell"],[i,b]],[/\b(q(?:mv|ta)\w+) b/i],[n,[r,"Verizon"],[i,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[n,[r,"Barnes & Noble"],[i,b]],[/\b(tm\d{3}\w+) b/i],[n,[r,"NuVision"],[i,b]],[/\b(k88) b/i],[n,[r,"ZTE"],[i,b]],[/\b(nx\d{3}j) b/i],[n,[r,"ZTE"],[i,f]],[/\b(gen\d{3}) b.+49h/i],[n,[r,"Swiss"],[i,f]],[/\b(zur\d{3}) b/i],[n,[r,"Swiss"],[i,b]],[/\b((zeki)?tb.*\b) b/i],[n,[r,"Zeki"],[i,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[r,"Dragon Touch"],n,[i,b]],[/\b(ns-?\w{0,9}) b/i],[n,[r,"Insignia"],[i,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[n,[r,"NextBook"],[i,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[r,"Voice"],n,[i,f]],[/\b(lvtel\-)?(v1[12]) b/i],[[r,"LvTel"],n,[i,f]],[/\b(ph-1) /i],[n,[r,"Essential"],[i,f]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[n,[r,"Envizen"],[i,b]],[/\b(trio[-\w\. ]+) b/i],[n,[r,"MachSpeed"],[i,b]],[/\btu_(1491) b/i],[n,[r,"Rotor"],[i,b]],[/(shield[\w ]+) b/i],[n,[r,"Nvidia"],[i,b]],[/(sprint) (\w+)/i],[r,n,[i,f]],[/(kin\.[onetw]{3})/i],[[n,/\./g," "],[r,Ne],[i,f]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[n,[r,Ae],[i,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[n,[r,Ae],[i,f]],[/smart-tv.+(samsung)/i],[r,[i,E]],[/hbbtv.+maple;(\d+)/i],[[n,/^/,"SmartTV"],[r,J],[i,E]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[r,Me],[i,E]],[/(apple) ?tv/i],[r,[n,Y+" TV"],[i,E]],[/crkey/i],[[n,ue+"cast"],[r,Z],[i,E]],[/droid.+aft(\w+)( bui|\))/i],[n,[r,se],[i,E]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[n,[r,nt],[i,E]],[/(bravia[\w ]+)( bui|\))/i],[n,[r,de],[i,E]],[/(mitv-\w{5}) bui/i],[n,[r,Re],[i,E]],[/Hbbtv.*(technisat) (.*);/i],[r,n,[i,E]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[r,Ce],[n,Ce],[i,E]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[i,E]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[r,n,[i,X]],[/droid.+; (shield) bui/i],[n,[r,"Nvidia"],[i,X]],[/(playstation [345portablevi]+)/i],[n,[r,de],[i,X]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[n,[r,Ne],[i,X]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[n,[r,J],[i,C]],[/((pebble))app/i],[r,n,[i,C]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[n,[r,Y],[i,C]],[/droid.+; (glass) \d/i],[n,[r,Z],[i,C]],[/droid.+; (wt63?0{2,3})\)/i],[n,[r,Ae],[i,C]],[/droid.+; (glass) \d/i],[n,[r,Z],[i,C]],[/(pico) (4|neo3(?: link|pro)?)/i],[r,n,[i,C]],[/; (quest( \d| pro)?)/i],[n,[r,rt],[i,C]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[r,[i,Ie]],[/(aeobc)\b/i],[n,[r,se],[i,Ie]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[n,[i,f]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[n,[i,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[i,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[i,f]],[/(android[-\w\. ]{0,9});.+buil/i],[n,[r,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[c,[a,Vt+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[a,c],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[c,[a,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[a,c],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[c,a]],os:[[/microsoft (windows) (vista|xp)/i],[a,c],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[a,[c,me,ut]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,me,ut],[a,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[c,/_/g,"."],[a,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[a,at],[c,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[c,a],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[a,c],[/\(bb(10);/i],[c,[a,et]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[c,[a,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[c,[a,le+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[c,[a,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[c,[a,"watchOS"]],[/crkey\/([\d\.]+)/i],[c,[a,ue+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[a,ot],c],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[a,c],[/(sunos) ?([\w\.\d]*)/i],[[a,"Solaris"],c],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[a,c]]},P=function(v,h){if(typeof v===y&&(h=v,v=t),!(this instanceof P))return new P(v,h).getResult();var m=typeof e!==w&&e.navigator?e.navigator:t,T=v||(m&&m.userAgent?m.userAgent:u),O=m&&m.userAgentData?m.userAgentData:t,N=h?Dt(lt,h):lt,g=m&&m.userAgent==T;return this.getBrowser=function(){var d={};return d[a]=t,d[c]=t,Q.call(d,T,N.browser),d[k]=Ft(d[c]),g&&m&&m.brave&&typeof m.brave.isBrave==p&&(d[a]="Brave"),d},this.getCPU=function(){var d={};return d[_]=t,Q.call(d,T,N.cpu),d},this.getDevice=function(){var d={};return d[r]=t,d[n]=t,d[i]=t,Q.call(d,T,N.device),g&&!d[i]&&O&&O.mobile&&(d[i]=f),g&&d[n]=="Macintosh"&&m&&typeof m.standalone!==w&&m.maxTouchPoints&&m.maxTouchPoints>2&&(d[n]="iPad",d[i]=b),d},this.getEngine=function(){var d={};return d[a]=t,d[c]=t,Q.call(d,T,N.engine),d},this.getOS=function(){var d={};return d[a]=t,d[c]=t,Q.call(d,T,N.os),g&&!d[a]&&O&&O.platform&&O.platform!="Unknown"&&(d[a]=O.platform.replace(/chrome os/i,ot).replace(/macos/i,at)),d},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return T},this.setUA=function(d){return T=typeof d===l&&d.length>_e?Ce(d,_e):d,this},this.setUA(T),this};P.VERSION=o,P.BROWSER=pe([a,c,k]),P.CPU=pe([_]),P.DEVICE=pe([n,r,i,X,f,E,b,C,Ie]),P.ENGINE=P.OS=pe([a,c]),typeof oe!==w?(typeof Pe!==w&&Pe.exports&&(oe=Pe.exports=P),oe.UAParser=P):typeof define===p&&define.amd?define(function(){return P}):typeof e!==w&&(e.UAParser=P);var F=typeof e!==w&&(e.jQuery||e.Zepto);if(F&&!F.ua){var fe=new P;F.ua=fe.getResult(),F.ua.get=function(){return fe.getUA()},F.ua.set=function(v){fe.setUA(v);var h=fe.getResult();for(var m in h)F.ua[m]=h[m]}}})(typeof window=="object"?window:oe)});import{webcrypto as mt}from"node:crypto";var pt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Qt=128,B,z;function ei(e){!B||B.length<e?(B=Buffer.allocUnsafe(e*Qt),mt.getRandomValues(B),z=0):z+e>B.length&&(mt.getRandomValues(B),z=0),z+=e}function j(e=21){ei(e|=0);let t="";for(let o=z-e;o<z;o++)t+=pt[B[o]&63];return t}var ft="http://localhost:5987";var L=e=>e==null,M=e=>!L(e);var ti="__bigint__",wt=(e,t)=>typeof t=="bigint"?{[ti]:`${t}`}:t;var qe=class extends Error{constructor(o,u){super(`[${o}] Orbiter Error: ${u}`);this.status=o;this.statusText=u}},we=class{#e;constructor({container:t,orbiterId:o}){let s=M(t)&&t!==!1?t===!0?ft:t:"https://icp0.io",{protocol:p,host:w}=new URL(s);this.#e=`${p}//${o}.${w}`}postPageViews=async({request:t})=>await this.post({path:"/views",payload:t});postTrackEvents=async({request:t})=>await this.post({path:"/events",payload:t});postPerformanceMetrics=async({request:t})=>await this.post({path:"/metrics",payload:t});post=async({path:t,payload:o})=>{let u=await fetch(`${this.#e}${t}`,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(o,wt)});if(!u.ok)throw new qe(u.status,u.statusText);return await u.json()}};var be=class{#e;#t;constructor(t){this.#e=t,this.#t=new we(t)}setPageView=async t=>{let o={...this.satelliteId(),page_views:[t]};return await this.#t.postPageViews({request:o})};setTrackEvent=async t=>{let o={...this.satelliteId(),track_events:[t]};return await this.#t.postTrackEvents({request:o})};setPerformanceMetric=async t=>{let o={...this.satelliteId(),performance_metrics:[t]};return await this.#t.postPerformanceMetrics({request:o})};satelliteId(){return{satellite_id:this.#e.satelliteId}}};var bt=()=>BigInt(Date.now())*BigInt(1e6);var H=()=>({collected_at:bt()}),ee=()=>{let{userAgent:e}=navigator;return M(e)?{user_agent:e}:{}};var Ee=class e{async startPerformance({sessionId:t,postPerformanceMetric:o}){let{onCLS:u,onFCP:s,onINP:p,onLCP:w,onTTFB:y}=await Promise.resolve().then(()=>(Nt(),Mt)),l=k=>{(async()=>await e.setPerformanceMetric({metric:{...k,sessionId:t},postPerformanceMetric:o}))()};u(l),s(l),p(l),w(l),y(l)}static setPerformanceMetric=async({metric:t,postPerformanceMetric:o})=>{let u=e.mapPerformanceMetric(t);if(u==="unknown"){console.warn("Performance metric ignored. Unknown metric name.",t);return}u!=="deprecated"&&await o({key:{key:j(),...H()},performance_metric:u})};static mapPerformanceMetric({sessionId:t,name:o,value:u,delta:s,id:p,navigationType:w}){let l=(()=>{switch(o){case"CLS":case"FCP":case"INP":case"LCP":case"TTFB":return o;case"FID":return"deprecated";default:return"unknown"}})();if(l==="unknown"||l==="deprecated")return l;let n=(()=>{switch(w){case"navigate":return"Navigate";case"restore":return"Restore";case"reload":return"Reload";case"back-forward":return"BackForward";case"back-forward-cache":return"BackForwardCache";case"prerender":return"Prerender";default:return}})(),a={value:u,delta:s,id:p,...M(n)&&{navigation_type:n}},{location:{href:i}}=document;return{href:i,metric_name:l,session_id:t,data:{WebVitalsMetric:a},...ee()}}};var Se=class{async parseUserAgent(t){if(L(t))return;let o=await Promise.resolve().then(()=>Jt(Rt(),1)),u=new o.default(t),{browser:s,os:p,device:w}=u.getResult();if(!(L(s.name)||L(p.name)))return{browser:s.name,os:p.name,device:w?.type}}};var Ye=class extends Error{},V=(e,t)=>{if(e==null)throw new Ye(t)};var xe=()=>typeof window<"u";var bi="Unable to connect to the analytics services. Did you call `initOrbiter`?",ae=e=>{L(e)&&console.warn(bi)};var vi=()=>{if(!(typeof crypto>"u"))return j()},$=vi(),S,At=e=>(S={orbiter:new be(e),userAgent:e.options?.userAgentParser===!0?new Se:null,performance:e.options?.performance===!0?new Ee:null},{cleanup(){S=null}}),Ct=()=>{let e=async()=>await Je(),t=new Proxy(history.pushState,{apply:async(o,u,s)=>{o.apply(u,s),await e()}});return history.pushState=t,addEventListener("popstate",e,{passive:!0}),{cleanup(){t=null,removeEventListener("popstate",e,!1)}}},Ze="No session ID initialized.",Ke=async()=>{if(!xe())return;V($,Ze);let{title:e,location:{href:t},referrer:o}=document,{innerWidth:u,innerHeight:s,screen:p}=window,{timeZone:w}=Intl.DateTimeFormat().resolvedOptions(),{user_agent:y}=ee(),l=M(S?.userAgent)?await S?.userAgent.parseUserAgent(y):void 0,k={title:e,href:t,...M(o)&&o!==""&&{referrer:o},device:{inner_width:u,inner_height:s,screen_width:p?.availWidth,screen_height:p?.availHeight},time_zone:w,session_id:$,user_agent:y,...M(l)&&{client:l}};ae(S),await S?.orbiter?.setPageView({key:{key:j(),...H()},page_view:k})},Ot=async()=>{if(!xe()||L(S?.performance))return;V($,Ze),ae(S);let e=async t=>{ae(S),await S?.orbiter?.setPerformanceMetric(t)};await S.performance.startPerformance({sessionId:$,postPerformanceMetric:e})},hi=()=>{Je()},Je=async()=>{await Ke()},gi=e=>{Lt(e)},Lt=async e=>{xe()&&(V($,Ze),ae(S),await S?.orbiter?.setTrackEvent({key:{key:j(),...H()},track_event:{...e,session_id:$,...ee(),...H()}}))};var qt=()=>{let e=()=>typeof import.meta<"u"&&typeof import.meta.env<"u"?import.meta.env?.VITE_SATELLITE_ID??import.meta.env?.PUBLIC_SATELLITE_ID:void 0;return typeof process<"u"?process.env?.NEXT_PUBLIC_SATELLITE_ID??e():e()},Bt=()=>{let e=()=>typeof import.meta<"u"&&typeof import.meta.env<"u"?import.meta.env?.VITE_ORBITER_ID??import.meta.env?.PUBLIC_ORBITER_ID:void 0;return typeof process<"u"?process.env?.NEXT_PUBLIC_ORBITER_ID??e():e()},Ut=()=>{let e=()=>typeof import.meta<"u"&&typeof import.meta.env<"u"?import.meta.env?.VITE_CONTAINER??import.meta.env?.PUBLIC_CONTAINER:void 0;return typeof process<"u"?process.env?.NEXT_PUBLIC_CONTAINER??e():e()};var yi=e=>{let t=e?.satelliteId??qt();V(t,"Satellite ID is not configured. Orbiter cannot be initialized without a target Satellite.");let o=e?.orbiterId??Bt();V(o,"Orbiter ID is not configured. The analytics cannot be initialized without an Orbiter.");let u=e?.container??Ut();return{orbiterId:o,satelliteId:t,container:u,options:e?.options}},dn=e=>{let t=yi(e),{cleanup:o}=At(t);Ke();let{cleanup:u}=Ct();return Ot(),()=>{o(),u()}};export{dn as initOrbiter,gi as trackEvent,Lt as trackEventAsync,hi as trackPageView,Je as trackPageViewAsync};
|
|
4
4
|
//# sourceMappingURL=index.mjs.map
|